Prose information transmission method, terminal, and communications device

ABSTRACT

The present disclosure provides a ProSe information transmission method, a terminal, and a communications device. The method includes: acquiring, by a second terminal, a fourth code word broadcast by a first terminal, where the fourth code word is a code word that is allocated to the first terminal by a first ProSe entity; sending, by the second terminal, a first message to a second ProSe entity when the fourth code word matches a prestored code word, where the first message carries the fourth code word and a first application identity; receiving, by the second terminal, a second message sent by the second ProSe entity, where the second message carries a second identity; and discovering, by the second terminal, a first application user according to the second identity. The present disclosure is applicable to the communications field.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/303,406, filed on Oct. 11, 2016, which is a National Stage ofInternational Application No. PCT/CN2014/085616, filed on Aug. 29, 2014,which claims priority to International Patent Application No.PCT/CN2014/081292, filed on Jun. 30, 2014. All of the afore-mentionedpatent applications are hereby incorporated by reference in theirentireties.

TECHNICAL FIELD

The present disclosure relates to the communications field, and inparticular, to a proximity service (ProSe) information transmissionmethod, a user terminal (UE), and a communications device.

BACKGROUND

In a traditional mobile network, a data communication path betweenterminals needs to pass through a core network entity serving gateway(SGW)/a packet data network gateway (PGW). Therefore, even when data istransferred between two terminals in close proximity, transmission stillneeds to go through a core network, resulting in a relatively greatrequirement for network transmission bandwidth and relatively lowtransmission efficiency.

To resolve the problem, a ProSe project is proposed. ProSe requires thatterminals directly perform data exchange with each other, or that dataexchange is performed only by using a base station but not by using acore network entity SGW/PGW. Therefore, communication efficiency betweenterminals in proximity can be improved.

To implement direct communication between terminals, two terminals needto perform mutual discovery. In some scenarios, mutual discovery betweentwo terminals may be converted into mutual discovery between twoapplication users, that is, if application users of a same applicationon two terminals implement mutual discovery, it may be considered thatthe two terminals have discovered each other. In the prior art, when twoapplication users perform mutual discovery, the following problemexists:

In a process of mutual discovery between terminals, a second terminalhas already stored a correspondence between an APP User ID of a firstterminal and a corresponding code word of the APP User ID, andtherefore, after obtaining, by means of monitoring, a code word,broadcast by the first terminal, of an application terminal identity(APP User ID) of the first terminal, the second terminal may directlydiscover the first terminal, but a network cannot learn an event thattwo application users have discovered each other, which is unfavorableto expense settlement of an operator and monitoring of a network event.

SUMMARY

Embodiments of the present disclosure provide a ProSe informationtransmission method, a terminal, and a communications device, which canresolve a problem that a network fails to learn an event thatapplication users discover each other.

To achieve the foregoing objective, the embodiments of the presentdisclosure provide the following solutions:

According to a first aspect, a proximity service ProSe informationtransmission method is provided, where the method includes:

receiving, by a second ProSe entity, a first message sent by a secondterminal, where the first message is used to instruct the second ProSeentity to acquire a second identity, the second identity is a temporaryapplication user identity that is allocated to a first application userby a first application server, the first application user is a user of afirst application of a first terminal, the first application server isan application server of the first application, and the second ProSeentity is a ProSe entity in a home public land mobile network HPLMN ofthe second terminal;

acquiring, by the second ProSe entity, the second identity; and

sending, by the second ProSe entity, a second message to the secondterminal, where the second message carries the second identity, and thesecond identity is used to indicate the first application userdiscovered by the second terminal.

With reference to the first aspect, in a first possible implementationmanner of the first aspect, the second message further carries a firstapplication identity, the first application identity is an applicationidentity of the first application, and the first application identity isused to indicate the first application corresponding to the secondidentity.

With reference to the first aspect or the first possible implementationmanner of the first aspect, in a second possible implementation mannerof the first aspect, the first message carries a fourth code word andthe first application identity, the fourth code word is a code word thatis allocated to the first terminal by a first ProSe entity, the firstapplication identity is the application identity of the firstapplication, and the first ProSe entity is a ProSe entity in an HPLMN ofthe first terminal; and

the acquiring, by the second ProSe entity, the second identity includes:

sending, by the second ProSe entity, a third message to the first ProSeentity, where the third message carries the fourth code word and thefirst application identity, so that the first ProSe entity acquires thefourth code word and the second identity corresponding to the firstapplication identity; and

receiving, by the second ProSe entity, a fourth message sent by thefirst ProSe entity, where the fourth message carries the secondidentity.

With reference to the second possible implementation manner of the firstaspect, in a third possible implementation manner of the first aspect,the fourth message further carries the first application identity, andthe first application identity is used to indicate the first applicationcorresponding to the second identity.

With reference to the first aspect to the third possible implementationmanner of the first aspect, in a fourth possible implementation mannerof the first aspect, before the receiving, by a second ProSe entity, afirst message sent by a second terminal, the method further includes:

receiving, by the second ProSe entity, a fifth message sent by thesecond terminal, where the fifth message is used to instruct the secondProSe entity to acquire the fourth code word, the fourth code word isthe code word that is allocated to the first terminal by the first ProSeentity, and the first ProSe entity is the ProSe entity in the HPLMN ofthe first terminal;

acquiring, by the second ProSe entity, the fourth code word; and

sending, by the second ProSe entity, a sixth message to the secondterminal, where the sixth message carries the fourth code word.

With reference to the fourth possible implementation manner of the firstaspect, in a fifth possible implementation manner of the first aspect,the fifth message carries a third identity and the first applicationidentity, the third identity is a temporary terminal identity that isallocated to the second terminal by the second ProSe entity, and thefirst application identity is the application identity of the firstapplication; and

the acquiring, by the second ProSe entity, the fourth code wordincludes:

sending, by the second ProSe entity, a seventh message to the firstapplication server according to the first application identity, wherethe seventh message carries the third identity;

receiving, by the second ProSe entity, an eighth message sent by thefirst application server, where the eighth message carries a firstidentity, and the first identity is a temporary terminal identity thatis allocated to the first terminal by the first ProSe entity;

sending, by the second ProSe entity, a ninth message to the first ProSeentity, where the ninth message carries the first identity; and

receiving, by the second ProSe entity, a tenth message sent by the firstProSe entity, where the tenth message carries the fourth code word.

With reference to the fourth possible implementation manner of the firstaspect, in a sixth possible implementation manner of the first aspect,the fifth message carries first information, a fourth identity, and thefirst application identity, where the first information includes a thirdidentity or a sixth identity, the third identity is a temporary terminalidentity that is allocated to the second terminal by the second ProSeentity, the sixth identity is a terminal identity of the secondterminal, the fourth identity is a temporary application user identitythat is allocated to a second application user by the first applicationserver, the second application user is a user of the first applicationof the second terminal, and the first application identity is theapplication identity of the first application; and

the acquiring, by the second ProSe entity, the fourth code wordincludes:

sending, by the second ProSe entity, a seventh message to the firstapplication server according to the first application identity, wherethe seventh message carries the fourth identity;

receiving, by the second ProSe entity, an eighth message sent by thefirst application server, where the eighth message carries a firstidentity, and the first identity is a temporary terminal identity thatis allocated to the first terminal by the first ProSe entity;

sending, by the second ProSe entity, a ninth message to the first ProSeentity, where the ninth message carries the first identity; and

receiving, by the second ProSe entity, a tenth message sent by the firstProSe entity, where the tenth message carries the fourth code word.

With reference to the first aspect or the first possible implementationmanner of the first aspect, in a seventh possible implementation mannerof the first aspect, the first message carries a first code word, thefirst code word is a code word that is allocated to the second identityby a first ProSe entity, and the first ProSe entity is a ProSe entity inan HPLMN of the first terminal; and

the acquiring, by the second ProSe entity, the second identity includes:

acquiring, by the second ProSe entity, the second identity according tothe first code word.

With reference to the seventh possible implementation manner of thefirst aspect, in an eighth possible implementation manner of the firstaspect, before the sending, by the second ProSe entity, a second messageto the second terminal, the method further includes:

sending, by the second ProSe entity, a third message to the firstapplication server, where the third message carries the second identity,and the second identity is a basis on which the first application serverdetermines that an broadcast request of the first application user isallowed; and

receiving, by the second ProSe entity, a fourth message sent by thefirst application server, where the fourth message indicates that thebroadcast request of the first application user is allowed.

With reference to the seventh possible implementation manner of thefirst aspect or the eighth possible implementation manner of the firstaspect, in a ninth possible implementation manner of the first aspect,after the sending a second message to the second terminal, the methodfurther includes:

sending, by the second ProSe entity, a fifth message to the first ProSeentity, where the fifth message carries a first identity, the firstapplication identity, and a fourth identity, the first identity is atemporary terminal identity that is allocated to the first terminal bythe first ProSe entity, the first application identity is theapplication identity of the first application, the fourth identity is atemporary application user identity that is allocated to a secondapplication user by the first application server, and the secondapplication user is a user of the first application of the secondterminal.

With reference to the seventh possible implementation manner of thefirst aspect to the ninth possible implementation manner of the firstaspect, in a tenth possible implementation manner of the first aspect,before the receiving, by a second ProSe entity, a first message, themethod further includes:

receiving, by the second ProSe entity, a sixth message sent by thesecond terminal, where the sixth message carries a third identity andthe first application identity, the third identity is a temporaryterminal identity that is allocated to the second terminal by the secondProSe entity, and the first application identity is the applicationidentity of the first application;

determining, by the second ProSe entity, the fourth identity accordingto the third identity and the first application identity, where thefourth identity is the temporary application user identity that isallocated to the second application user by the first applicationserver, and the second application user is the user of the firstapplication of the second terminal;

sending, by the second ProSe entity, a seventh message to the firstapplication server, where the seventh message carries the fourthidentity;

receiving, by the second ProSe entity, an eighth message sent by thefirst application server, where the eighth message carries acorrespondence between the first identity and the second identity, wherethe correspondence between the first identity and the second identity isdetermined by the first application server according to the fourthidentity, and the first identity is the temporary terminal identity thatis allocated to the first terminal by the first ProSe entity;

sending, by the second ProSe entity, a ninth message to the first ProSeentity, where the ninth message carries the first identity and the firstapplication identity;

receiving, by the second ProSe entity, a tenth message sent by the firstProSe entity, where the tenth message carries the first code word, andthe first code word is determined by the first ProSe entity according tothe first identity and the first application identity; and

sending, by the second ProSe entity, an eleventh message to the secondterminal, where the eleventh message carries the first code word.

With reference to the seventh possible implementation manner of thefirst aspect to the ninth possible implementation manner of the firstaspect, in an eleventh possible implementation manner of the firstaspect, before the receiving, by a second ProSe entity, a first message,the method further includes:

receiving, by the second ProSe entity, a sixth message sent by the firstapplication server, where the sixth message carries a correspondencebetween the first identity and the second identity, the firstapplication identity, and a third identity, the first identity is thetemporary terminal identity that is allocated to the first terminal bythe first ProSe entity, the first application identity is theapplication identity of the first application, and the third identity isa temporary terminal identity that is allocated to the second terminalby the second ProSe entity;

sending, by the second ProSe entity, a seventh message to the firstProSe entity, where the seventh message carries the first identity andthe first application identity;

receiving, by the second ProSe entity, an eighth message sent by thefirst ProSe entity, where the eighth message carries the first codeword, and the first code word is determined by the first ProSe entityaccording to the first identity and the first application identity; and

sending, by the second ProSe entity, a ninth message to the secondterminal, where the ninth message carries the first code word.

According to a second aspect, a proximity service ProSe informationtransmission method is provided, where the method includes:

acquiring, by a second terminal, a fourth code word broadcast by a firstterminal, where the fourth code word is a code word that is allocated tothe first terminal by a first ProSe entity, and the first ProSe entityis a ProSe entity in a home public land mobile network HPLMN of thefirst terminal;

sending, by the second terminal, a first message to a second ProSeentity when the fourth code word matches a prestored code word, wherethe first message carries the fourth code word and a first applicationidentity, the first application identity is an application identity of afirst application, and the second ProSe entity is a ProSe entity in anHPLMN of the second terminal;

receiving, by the second terminal, a second message sent by the secondProSe entity, where the second message carries a second identity, thesecond identity is a temporary application user identity that isallocated to a first application user by a first application server, thefirst application user is a user of the first application of the firstterminal, and the first application server is an application server ofthe first application; and

discovering, by the second terminal, the first application useraccording to the second identity.

With reference to the second aspect, in a first possible implementationmanner of the second aspect, the second message further carries thefirst application identity, and the first application identity is usedto indicate the first application corresponding to the second identity.

With reference to the second aspect or the first possible implementationmanner of the second aspect, in a second possible implementation mannerof the second aspect, when the fourth code word matches the prestoredcode word, and before the acquiring, by a second terminal, a fourth codeword broadcast by a first terminal, the method further includes:

sending, by the second terminal, a third message to the second ProSeentity, where the third message carries a third identity and the firstapplication identity, and the third identity is a temporary terminalidentity that is allocated to the second terminal by the second ProSeentity; and

receiving, by the second terminal, a fourth message sent by the secondProSe entity, where the fourth message carries the fourth code word.

With reference to the second aspect or the first possible implementationmanner of the second aspect, in a third possible implementation mannerof the second aspect, when the fourth code word matches the prestoredcode word, and before the acquiring, by a second terminal, a fourth codeword broadcast by a first terminal, the method further includes:

sending, by the second terminal, a third message to the second ProSeentity, where the third message carries first information, a fourthidentity, and the first application identity, where the firstinformation includes a third identity or a sixth identity, the thirdidentity is a temporary terminal identity that is allocated to thesecond terminal by the second ProSe entity, the sixth identity is aterminal identity of the second terminal, the fourth identity is atemporary application user identity that is allocated to a secondapplication user by the first application server, and the secondapplication user is a user of the first application of the secondterminal; and

receiving, by the second terminal, a fourth message sent by the secondProSe entity, where the fourth message carries the fourth code word.

According to a third aspect, a proximity service ProSe informationtransmission method is provided, where the method includes:

acquiring, by a second terminal, a first code word broadcast by a firstterminal, where the first code word is a code word that is allocated toa second identity by a first ProSe entity, the second identity is atemporary application user identity that is allocated to a firstapplication user by a first application server, the first applicationuser is a user of the first application of the first terminal, the firstapplication server is an application server of the first application,and the first ProSe entity is a ProSe entity in a home public landmobile network HPLMN of the first terminal;

sending, by the second terminal, a first message to a second ProSeentity when the first code word matches a prestored code word, where thefirst message carries the first code word, and the second ProSe entityis a ProSe entity in an HPLMN of the second terminal; and

receiving, by the second terminal, a second message sent by the secondProSe entity, where the second message carries the second identity, thesecond identity is determined by the second ProSe entity according tothe first code word, and the second identity is used to instruct todiscover the first application user.

With reference to the third aspect, in a first possible implementationmanner of the third aspect, when the first code word matches theprestored code word, and before the acquiring, by a second terminal, afirst code word broadcast by a first terminal, the method furtherincludes:

sending, by the second terminal, a third message to the second ProSeentity, where the third message carries a third identity and a firstapplication identity, the third identity is a temporary terminalidentity that is allocated to the second terminal by the second ProSeentity, and the first application identity is an application identity ofthe first application; and

receiving, by the second terminal, a fourth message sent by the secondProSe entity, where the fourth message carries the first code word, andthe first code word is determined by the second ProSe entity accordingto the third identity and the first application identity.

With reference to the third aspect, in a second possible implementationmanner of the third aspect, before the acquiring, by a second terminal,a first code word, the method further includes:

when the first application server is triggered, receiving, by the secondterminal, a third message sent by the second ProSe entity, where thethird message carries the first code word.

According to a fourth aspect, a second proximity service ProSe entity isprovided, where the second ProSe entity includes: a receiving unit, anacquiring unit, and a sending unit; where

the receiving unit is configured to receive a first message sent by asecond terminal, where the first message is used to instruct the secondProSe entity to acquire a second identity, the second identity is atemporary application user identity that is allocated to a firstapplication user by a first application server, the first applicationuser is a user of a first application of a first terminal, the firstapplication server is an application server of the first application,and the second ProSe entity is a ProSe entity in a home public landmobile network HPLMN of the second terminal;

the acquiring unit is configured to acquire the second identity; and

the sending unit is configured to send a second message to the secondterminal, where the second message carries the second identity, and thesecond identity is used to indicate the first application userdiscovered by the second terminal.

With reference to the fourth aspect, in a first possible implementationmanner of the fourth aspect, the first message carries a fourth codeword and a first application identity, the fourth code word is a codeword that is allocated to the first terminal by a first ProSe entity,the first application identity is the application identity of the firstapplication, and the first ProSe entity is a ProSe entity in an HPLMN ofthe first terminal; and

the acquiring unit is specifically configured to:

send a third message to the first ProSe entity, where the third messagecarries the fourth code word and the first application identity, so thatthe first ProSe entity acquires the fourth code word and the secondidentity corresponding to the first application identity; and

receive a fourth message sent by the first ProSe entity, where thefourth message carries the second identity.

With reference to the fourth aspect or the first possible implementationmanner of the fourth aspect, in a second possible implementation mannerof the fourth aspect, the receiving unit is further configured to:before receiving the first message sent by the second terminal, receivea fifth message sent by the second terminal, where the fifth message isused to instruct the second ProSe entity to acquire the fourth codeword, the fourth code word is the code word that is allocated to thefirst terminal by the first ProSe entity, and the first ProSe entity isthe ProSe entity in the HPLMN of the first terminal;

the acquiring unit is further configured to acquire the fourth codeword; and

the sending unit is further configured to send a sixth message to thesecond terminal, where the sixth message carries the fourth code word.

With reference to the second possible implementation manner of thefourth aspect, in a third possible implementation manner of the fourthaspect, the fifth message carries a third identity and the firstapplication identity, the third identity is a temporary terminalidentity that is allocated to the second terminal by the second ProSeentity, and the first application identity is the application identityof the first application; and

the acquiring unit is specifically configured to:

send a seventh message to the first application server according to thefirst application identity, where the seventh message carries the thirdidentity;

receive an eighth message sent by the first application server, wherethe eighth message carries a first identity, and the first identity is atemporary terminal identity that is allocated to the first terminal bythe first ProSe entity;

send a ninth message to the first ProSe entity, where the ninth messagecarries the first identity; and

receive a tenth message sent by the first ProSe entity, where the tenthmessage carries the fourth code word.

With reference to the second possible implementation manner of thefourth aspect, in a fourth possible implementation manner of the fourthaspect, the fifth message carries first information, a fourth identity,and the first application identity, where the first information includesa third identity or a sixth identity, the third identity is a temporaryterminal identity that is allocated to the second terminal by the secondProSe entity, the sixth identity is a terminal identity of the secondterminal, the fourth identity is a temporary application user identitythat is allocated to a second application user by the first applicationserver, the second application user is a user of the first applicationof the second terminal, and the first application identity is theapplication identity of the first application; and

the acquiring unit is specifically configured to:

send a seventh message to the first application server according to thefirst application identity, where the seventh message carries the fourthidentity;

receive an eighth message sent by the first application server, wherethe eighth message carries a first identity, and the first identity is atemporary terminal identity that is allocated to the first terminal bythe first ProSe entity;

send a ninth message to the first ProSe entity, where the ninth messagecarries the first identity; and

receive a tenth message sent by the first ProSe entity, where the tenthmessage carries the fourth code word.

With reference to the fourth aspect, in a fifth possible implementationmanner of the fourth aspect, the first message carries a first codeword, the first code word is a code word that is allocated to the secondidentity by a first ProSe entity, and the first ProSe entity is a ProSeentity in an HPLMN of the first terminal; and

the acquiring unit is specifically configured to:

acquire the second identity according to the first code word.

With reference to the fifth possible implementation manner of the fourthaspect, in a sixth possible implementation manner of the fourth aspect,the sending unit is further configured to: before sending the secondmessage to the second terminal, send a third message to the firstapplication server, where the third message carries the second identity,and the second identity is a basis on which the first application serverdetermines that an broadcast request of a first application user isallowed; and

the receiving unit is further configured to receive a fourth messagesent by the first application server, where the fourth message indicatesthat the broadcast request of the first application user is allowed.

With reference to the fifth possible implementation manner of the fourthaspect or the sixth possible implementation manner of the fourth aspect,in a seventh possible implementation manner of the fourth aspect, thesending unit is further configured to: after sending the second messageto the second terminal, send a fifth message to the first ProSe entity,where the fifth message carries a first identity, the first applicationidentity, and a fourth identity, the first identity is a temporaryterminal identity that is allocated to the first terminal by the firstProSe entity, the first application identity is the application identityof the first application, the fourth identity is a temporary applicationuser identity that is allocated to a second application user by thefirst application server, and the second application user is a user ofthe first application of the second terminal.

With reference to the fifth possible implementation manner of the fourthaspect to the seventh possible implementation manner of the fourthaspect, in an eighth possible implementation manner of the fourthaspect, the second ProSe entity further includes a determining unit; and

the receiving unit is further configured to: before receiving the firstmessage, receive a sixth message sent by the second terminal, where thesixth message carries a third identity and the first applicationidentity, the third identity is a temporary terminal identity that isallocated to the second terminal by the second ProSe entity, and thefirst application identity is the application identity of the firstapplication;

the determining unit is configured to determine the fourth identityaccording to the third identity and the first application identity,where the fourth identity is the temporary application user identitythat is allocated to the second application user by the firstapplication server, and the second application user is the user of thefirst application of the second terminal;

the sending unit is further configured to send a seventh message to thefirst application server, where the seventh message carries the fourthidentity;

the receiving unit is further configured to receive an eighth messagesent by the first application server, where the eighth message carries acorrespondence between the first identity and the second identity, wherethe correspondence between the first identity and the second identity isdetermined by the first application server according to the fourthidentity, and the first identity is the temporary terminal identity thatis allocated to the first terminal by the first ProSe entity;

the sending unit is further configured to send a ninth message to thefirst ProSe entity, where the ninth message carries the first identityand the first application identity;

the receiving unit is further configured to receive a tenth message sentby the first ProSe entity, where the tenth message carries the firstcode word, and the first code word is determined by the first ProSeentity according to the first identity and the first applicationidentity; and

the sending unit is further configured to send an eleventh message tothe second terminal, where the eleventh message carries the first codeword.

With reference to the fifth possible implementation manner of the fourthaspect to the seventh possible implementation manner of the fourthaspect, in a ninth possible implementation manner of the fourth aspect,the receiving unit is further configured to: before receiving the firstmessage, receive a sixth message sent by the first application server,where the sixth message carries a correspondence between the firstidentity and the second identity, the first application identity, and athird identity, the first identity is a temporary terminal identity thatis allocated to the first terminal by the first ProSe entity, the firstapplication identity is the application identity of the firstapplication, and the third identity is a temporary terminal identitythat is allocated to the second terminal by the second ProSe entity;

the sending unit is further configured to send a seventh message to thefirst ProSe entity, where the seventh message carries the first identityand the first application identity;

the receiving unit is further configured to receive an eighth messagesent by the first ProSe entity, where the eighth message carries thefirst code word, and the first code word is determined by the firstProSe entity according to the first identity and the first applicationidentity; and

the sending unit is further configured to send a ninth message to thesecond terminal, where the ninth message carries the first code word.

According to a fifth aspect, a second terminal is provided, where thesecond terminal includes: an acquiring unit, a sending unit, a receivingunit, and a discovery unit; where

the acquiring unit is configured to acquire a fourth code word broadcastby a first terminal, where the fourth code word is a code word that isallocated to the first terminal by a first ProSe entity, and the firstProSe entity is a ProSe entity in a home public land mobile networkHPLMN of the first terminal;

the sending unit is configured to send a first message to a second ProSeentity when the fourth code word matches a prestored code word, wherethe first message carries the fourth code word and a first applicationidentity, the first application identity is an application identity of afirst application, and the second ProSe entity is a ProSe entity in anHPLMN of the second terminal;

the receiving unit is configured to receive a second message sent by thesecond ProSe entity, where the second message carries a second identity,the second identity is a temporary application user identity that isallocated to a first application user by a first application server, thefirst application user is a user of the first application of the firstterminal, and the first application server is an application server ofthe first application; and

the discovery unit is configured to discover the first application useraccording to the second identity.

With reference to the fifth aspect, in a first possible implementationmanner of the fifth aspect, the sending unit is further configured tosend a third message to the second ProSe entity when the fourth codeword matches the prestored code word and before the acquiring unitacquires the fourth code word broadcast by the first terminal, where thethird message carries a third identity and the first applicationidentity, and the third identity is a temporary terminal identity thatis allocated to the second terminal by the second ProSe entity; and

the receiving unit is further configured to receive a fourth messagesent by the second ProSe entity, where the fourth message carries thefourth code word.

With reference to the fifth aspect, in a second possible implementationmanner of the fifth aspect, the sending unit is further configured tosend a third message to the second ProSe entity when the fourth codeword matches the prestored code word and before the acquiring unitacquires the fourth code word broadcast by the first terminal, where thethird message carries first information, a fourth identity, and thefirst application identity, where the first information includes a thirdidentity or a sixth identity, the third identity is a temporary terminalidentity that is allocated to the second terminal by the second ProSeentity, the sixth identity is a terminal identity of the secondterminal, the fourth identity is a temporary application user identitythat is allocated to a second application user by the first applicationserver, and the second application user is a user of the firstapplication of the second terminal; and

the receiving unit is further configured to receive a fourth messagesent by the second ProSe entity, where the fourth message carries thefourth code word.

According to a sixth aspect, a second terminal is provided, where thesecond terminal includes: an acquiring unit, a sending unit, and areceiving unit; where

the acquiring unit is configured to acquire a first code word broadcastby a first terminal, where the first code word is a code word that isallocated to a second identity by a first ProSe entity, the secondidentity is a temporary application user identity that is allocated to afirst application user by a first application server, the firstapplication user is a user of the first application of the firstterminal, the first application server is an application server of thefirst application, and the first ProSe entity is a ProSe entity in ahome public land mobile network HPLMN of the first terminal;

the sending is configured to send a first message to a second ProSeentity when the first code word matches a prestored code word, where thefirst message carries the first code word, and the second ProSe entityis a ProSe entity in an HPLMN of the second terminal; and

the receiving unit is configured to receive a second message sent by thesecond ProSe entity, where the second message carries the secondidentity, the second identity is determined by the second ProSe entityaccording to the first code word, and the second identity is used toinstruct to discover the first application user.

With reference to the sixth aspect, in a first possible implementationmanner of the sixth aspect, the sending unit is further configured to:when the first code word matches the prestored code word, and before theacquiring unit acquires the first code word broadcast by the firstterminal, send a third message to the second ProSe entity, where thethird message carries a third identity and a first application identity,the third identity is a temporary terminal identity that is allocated tothe second terminal by the second ProSe entity, and the firstapplication identity is an application identity of the firstapplication; and

the receiving unit is further configured to receive a fourth messagesent by the second ProSe entity, where the fourth message carries thefirst code word, and the first code word is determined by the secondProSe entity according to the third identity and the first applicationidentity.

With reference to the sixth aspect, in a second possible implementationmanner of the sixth aspect, the receiving unit is further configured to:before the acquiring unit acquires the first code word, when the firstapplication server is triggered, receive a third message sent by thesecond ProSe entity, where the third message carries the first codeword.

By using the foregoing solutions, in one aspect, after sending a firstmessage to a second terminal, a second ProSe entity may receive a secondmessage that carries a second identity, where the second identity isused to instruct to discover a first application user. It may be learnedthat, the second ProSe entity can learn an event that a secondapplication user discovers the first application user, and further afirst ProSe entity can also learn the event that the second applicationuser discovers the first application user. That is, a network can learnan event that two application users discover each other, which istherefore favorable to expense settlement of an operator and monitoringof a network event. In another aspect, in a ProSe informationtransmission process, a terminal identity in the prior art is replacedwith a temporary terminal identity, and a temporary application useridentity in the prior art is replaced with a temporary application useridentity, that is, information carried in a process of 3GPPcommunication between a terminal and a ProSe entity is correspondinginformation temporarily allocated by the ProSe entity or an applicationserver, and does not belong to personal privacy. Therefore, there is nopotential security problem in transmission at a 3GPP layer, and theapplication server may support this transmission manner.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure or in the prior art more clearly, the following brieflydescribes the accompanying drawings required for describing theembodiments or the prior art. Apparently, the accompanying drawings inthe following description show merely some embodiments of the presentdisclosure, and a person of ordinary skill in the art may still deriveother drawings from these accompanying drawings without creativeefforts.

FIG. 1A and FIG. 1B are a schematic interworking diagram of a method inthe prior art in which two application users discover each otheraccording to an embodiment of the present disclosure;

FIG. 2 is a schematic flowchart 1 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 3 is a schematic flowchart 2 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 4 is a schematic flowchart 3 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 5 is a schematic flowchart 4 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 6 is a schematic flowchart 5 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 7 is a schematic flowchart 6 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 8 is a schematic flowchart 7 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 9 is a schematic flowchart 8 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 10 is a schematic flowchart 9 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 11 is a schematic flowchart 10 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 12 is a schematic flowchart 11 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 13 is a schematic flowchart 12 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 14 is a schematic flowchart 13 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 15 is a schematic flowchart 14 of a ProSe information transmissionmethod according to an embodiment of the present disclosure;

FIG. 16 is a schematic interworking diagram 1 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 17 is a schematic interworking diagram 2 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 18 is a schematic interworking diagram 3 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 19 is a schematic interworking diagram 4 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 20 is a schematic interworking diagram 5 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 21 is a schematic interworking diagram 6 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 22A illustrates a first part of a schematic interworking diagram 7of a ProSe information transmission method according to an embodiment ofthe present disclosure;

FIG. 22 B illustrates a second part of a schematic interworking diagram7 of a ProSe information transmission method according to an embodimentof the present disclosure;

FIG. 23A illustrates a first part of a schematic interworking diagram 8of a ProSe information transmission method according to an embodiment ofthe present disclosure;

FIG. 23B illustrates a second part of a schematic interworking diagram 8of a ProSe information transmission method according to an embodiment ofthe present disclosure;

FIG. 24 is a schematic interworking diagram 9 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 25 is a schematic interworking diagram 10 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 26 is a schematic interworking diagram 11 of a ProSe informationtransmission method according to an embodiment of the presentdisclosure;

FIG. 27 is a schematic structural diagram 1 of a second ProSe entityaccording to an embodiment of the present disclosure;

FIG. 28 is a schematic structural diagram 2 of a second ProSe entityaccording to an embodiment of the present disclosure; and

FIG. 29 is a schematic structural diagram of a second terminal accordingto an embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

First, for brief description of the following embodiments, severalrelated definitions are provided as follows:

A first terminal is a terminal with a broadcast function.

A second terminal is a terminal with a monitoring function.

A first ProSe entity is a ProSe entity in a home public land mobilenetwork (HPLMN) of a first terminal, where the ProSe entity is a logicalfunction and is used in a ProSe; the ProSe entity is a function in thenetwork, and may be a separate entity, or may be carried on another corenetwork device, for example, a mobility management entity (MME), or aPGW; the ProSe entity includes a direct discovery name managementfunction (Direct Discovery Name Management Function) and is used toallocate a code word in a ProSe discovery process.

A second ProSe entity is a ProSe entity in an HPLMN of a secondterminal.

A first application identity (APP ID) is an APP ID of a firstapplication, and is generally an identity, in an operating system, ofsoftware used by a terminal.

A first application user is a user of a first application of a firstterminal.

A second application user is a user of a second application of a secondterminal.

A first identity is a temporary terminal identity (Temp UE ID) that isallocated to a first terminal by a first ProSe entity, where the Temp UEID may be used to uniquely determine UE in an evolved packet corenetwork (EPC).

The EPC is an evolved packet core network defined in the 3rd GenerationPartnership Project (3GPP) protocols, and technologies such as a LongTerm Evolution (LTE) technology and a High Rate Packet Data (HRPD)technology can be used to access the EPC.

It should be noted that the temporary terminal identity that isallocated to the first terminal by the first ProSe entity may be a realterminal identity of the first terminal, for example, a telephonenumber, which is not specifically limited in the embodiments of thepresent disclosure.

A second identity is a temporary application user identity (Temp APPUser ID) that is allocated to a first application user by an applicationserver, where the Temp APP User ID may be used to uniquely determine anapplication user in the application server.

It should be noted that the temporary application user identity that isallocated to the first application user by the application server may bea real application user identity of the first application user, forexample, a WeChat ID of the first application user, which is notspecifically limited in the embodiments of the present disclosure.

A third identity is a Temp UE ID that is allocated to a second terminalby a second ProSe entity, where the Temp UE ID may be used to uniquelydetermine UE in an EPC.

It should be noted that the temporary terminal identity that isallocated to the second terminal by the second ProSe entity may be areal terminal identity of the second terminal, for example, a telephonenumber, which is not specifically limited in the embodiments of thepresent disclosure.

A fourth identity is a Temp APP User ID that is allocated to a secondapplication user by an application server, where the Temp APP User IDmay be used to uniquely determine an application user in the applicationserver.

It should be noted that the temporary application user identity that isallocated to the second application user by the application server maybe a real application user identity of the second application user, forexample, a WeChat ID of the second application user, which is notspecifically limited in the embodiments of the present disclosure.

A first code word is a code word that is allocated to a second identityby a first ProSe entity.

A second code word is a code word that is allocated to a fourth identityby a second ProSe entity.

A fourth code word is a code word that is allocated to a first terminalby a first ProSe entity.

A sixth identity is a terminal identity of a second terminal.

A seventh identity is a terminal identity of a first terminal.

A first application server is an application server of a firstapplication.

Discovery refers to confirming that the other part is nearby.

ProSe information: ProSe information is ProSe information that isrequired for implementing a ProSe discovery process, and may be thefirst identity, the second identity, the third identity, the fourthidentity, the sixth identity, the seventh identity, the first code word,the second code word, and the fourth code word that are defined above,which is not specifically limited in the embodiments of the presentdisclosure.

It should be noted that the first code word, the second code word, and athird code word in the embodiments of the present disclosure may be of ahierarchical structure, and are digits that are converted fromcharacters and that can be broadcast by using an air interface.Exemplarily, a code word hierarchy provided herein is shown as follows:

PLMN ID APP ID Type (type) Temp UE ID

A PLMN ID generally refers to a mobile country code (MCC) and a mobilenetwork code (MNC). Certainly, the PLMN ID may have anotherrepresentation form, which is not specifically limited in theembodiments of the present disclosure. Exemplarily, if the PLMN ID is46000, it indicates a Chinese mobile operator, where 460 representsChina, and 00 represents a mobile operator.

As described above, an APP ID is generally an identity, in an operatingsystem, of software used by a terminal, and may be used to uniquelyidentify software.

Type indicates whether a current application user is open only to afriend, or open to anyone, or the like.

As described above, a Temp UE ID is a temporary terminal identity thatis allocated to a terminal by a ProSe, and may be used to uniquelyidentify a terminal.

Certainly, the foregoing code word hierarchy structure is merely anexemplary illustration, and the code word hierarchy structure mayinclude other information, which is not specifically limited in theembodiments of the present disclosure.

It should be noted that the foregoing definitions are applicable to allthe following embodiments of the disclosure. A unified illustration isprovided herein, and is not repeatedly described in the following.

In addition, to facilitate understanding of the background, a briefdescription of a method in the prior art in which two application usersdiscover each other is provided herein, and referring to FIG. 1A andFIG. 1B, the method includes the following steps:

101. A first terminal acquires an application user identity APP User IDof a second application user.

102. The first terminal sends a first message to a first ProSe entity,where the first message carries an APP User ID of the first terminal andthe APP User ID of the second application user.

103. The first ProSe entity receives the first message.

104. The first ProSe entity sends a second message to an applicationserver, where second message carries an APP User ID of a firstapplication user and the APP User ID of the second application user.

105. The application server receives the second message, and acquires,according to the second message, an algorithm that is used to convert anAPP User ID into a code word of the APP User ID.

106. The application server sends a third message to the first ProSeentity, where the third message carries the algorithm that is used toconvert an APP User ID into a code word of the APP User ID.

107. The first ProSe entity receives the third message, and converts theAPP User ID of the first application user and the APP User ID of thesecond application user into code words of the corresponding APP UserIDs according to the third message.

108. The first ProSe entity sends a fourth message to the firstterminal, where the fourth message carries a correspondence between theAPP User ID of the first application user and the code word of thecorresponding APP User ID and a correspondence between the APP User IDof the second application user and the code word of the correspondingAPP User ID.

109. The first terminal receives the fourth message and stores thecorrespondence between the APP User ID of the first application user andthe code word of the corresponding APP User ID and the correspondencebetween the APP User ID of the second application user and the code wordof the corresponding APP User ID.

110. The first terminal broadcasts the code word of the APP User ID ofthe first application user.

111. The second terminal obtains, by means of monitoring, the code wordof the APP User ID of the first application user.

It should be noted that the second terminal may perform a processsimilar to steps 101 to 109 by interacting with the second ProSe entityand the application server, and details are not repeatedly describedherein. That is, the second terminal may store the correspondencebetween the APP User ID of the first application user and the code wordof the APP User ID. Therefore, if the first application user and thesecond application user are mutual friends, after obtaining, by means ofmonitoring, the code word of the APP User ID of the first applicationuser, the second terminal may determine, according to the storedcorrespondence between the APP User ID of the first application user andthe code word of the APP User ID, the APP User ID corresponding to thecode word, obtained by means of monitoring, of the APP User ID of thefirst application user. That is, if the first application user is afriend of the second application user, after the second terminalobtains, by means of monitoring, the code word of the APP User ID of thefirst application user in this process, the second application candiscover the first application user, or the second terminal can discoverthe first terminal.

The following clearly and completely describes the technical solutionsin the embodiments of the present disclosure with reference to theaccompanying drawings in the embodiments of the present disclosure.Apparently, the described embodiments are merely some but not all of theembodiments of the present disclosure. All other embodiments obtained bya person of ordinary skill in the art based on the embodiments of thepresent disclosure without creative efforts shall fall within theprotection scope of the present disclosure.

To facilitate clear description of the technical solutions in theembodiments of the present disclosure, words such as “first”, “second”,“third”, and “fourth” are used in the embodiments of the presentdisclosure to distinguish between same items or similar items withbasically same functions or purposes. A person skilled in the art mayunderstand that the words such as “first”, “second”, “third”, and“fourth” do not restrict a quantity and an implementation sequence.

Embodiment 1

This embodiment of the present disclosure provides a ProSe informationtransmission method, which is specifically shown in FIG. 2, and includesthe following steps:

201. A second ProSe entity receives a first message sent by a secondterminal, where the first message is used to instruct the second ProSeentity to acquire a second identity.

202. The second ProSe entity acquires the second identity.

Specifically, the first message may carry a fourth code word and a firstapplication identity.

That the second ProSe entity acquires the second identity (step 202) mayspecifically include:

the second ProSe entity sends a third message to a first ProSe entity,where the third message carries the fourth code word and the firstapplication identity, so that the first ProSe entity acquires the fourthcode word and the second identity corresponding to the first applicationidentity; and

the second ProSe entity receives a fourth message sent by the firstProSe entity, where the fourth message carries the second identity.

Optionally, the fourth message may further carry the first applicationidentity, where the first application identity is used to indicate afirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

Certainly, the second ProSe entity may prestore a correspondence amongthe fourth code word, the first application identity, and the secondidentity. After receiving the first message that carries the fourth codeword and the first application identity, the second ProSe entity mayacquire the second identity according to the correspondence, which isnot specifically limited in this embodiment of the present disclosure.

203. The second ProSe entity sends a second message to the secondterminal, where the second message carries the second identity.

The second identity is used to indicate a first application userdiscovered by the second terminal.

Optionally, the second message may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

Further, as shown in FIG. 3, before that a second ProSe entity receivesa first message sent by a second terminal (step 201), the method mayfurther include the following steps:

204 a. The second ProSe entity receives a fifth message sent by thesecond terminal, where the fifth message is used to instruct the secondProSe entity to acquire a fourth code word.

205 a. The second ProSe entity acquires the fourth code word.

Specifically, the fifth message may carry a third identity and the firstapplication identity.

That the second ProSe entity acquires the fourth code word (step 205 a)may specifically include:

the second ProSe entity sends a seventh message to a first applicationserver according to the first application identity, where the seventhmessage carries the third identity;

the second ProSe entity receives an eighth message sent by the firstapplication server, where the eighth message carries a first identity;

the second ProSe entity sends a ninth message to the first ProSe entity,where the ninth message carries the first identity; and

the second ProSe entity receives a tenth message sent by the first ProSeentity, where the tenth message carries the fourth code word.

Optionally, the fifth message may further carry first information, afourth identity, and the first application identity, where the firstinformation includes a third identity or a sixth identity.

That the second ProSe entity acquires the fourth code word (step 205 a)may specifically include:

the second ProSe entity sends a seventh message to a first applicationserver according to the first application identity, where the seventhmessage carries the fourth identity;

the second ProSe entity receives an eighth message sent by the firstapplication server, where the eighth message carries a first identity;

the second ProSe entity sends a ninth message to the first ProSe entity,where the ninth message carries the first identity; and

the second ProSe entity receives a tenth message sent by the first ProSeentity, where the tenth message carries the fourth code word.

206 a. The second ProSe entity sends a sixth message to the secondterminal, where the sixth message carries the fourth code word.

In another possible implementation manner, the first message carries afirst code word, where the first code word is a code word that isallocated to the second identity by a first ProSe entity, and the firstProSe entity is a ProSe entity in an HPLMN of a first terminal.

That the second ProSe entity acquires the second identity specificallyincludes:

the second ProSe entity acquires the second identity according to thefirst code word.

Further, before that the second ProSe entity sends a second message tothe second terminal (step 201), the ProSe information transmissionmethod provided in this embodiment of the present disclosure may furtherinclude:

the second ProSe entity sends a third message to an application server,where the third message carries the second identity, and the secondidentity is a basis on which the application server determines that anbroadcast request of the first application user is allowed; and

the second ProSe entity receives a fourth message sent by theapplication server, where the fourth message indicates that thebroadcast request of the first application user is allowed.

That is, after the second ProSe entity learns an event that the firstapplication user is discovered, and before the second ProSe entity sendsthe second message to the second terminal, whether the broadcast requestof the first application user is allowed may be further determined on aside of the application server, and the second message is sent to thesecond terminal after the application server allows the broadcastrequest of the first application server. In this way, validity ofbroadcast of the first application user is further ensured, andtherefore, network security is ensured.

And/or

after that a second ProSe entity receives a first message sent by asecond terminal (step 201), the method may further include:

the second ProSe entity sends a fifth message to the first ProSe entity,where the fifth message carries a first identity, a first applicationidentity, and a fourth identity.

That is, after the second ProSe entity learns the event that the firstapplication user is discovered, the first ProSe entity may be notifiedof the event that the second application user discovers the firstapplication user, and further, the first ProSe entity is used to notifythe first terminal of the event that the second application userdiscovers the first application user. Therefore, it is ensured that whenperforming broadcast, the first terminal can learn in a timely mannerwhether the first terminal is discovered by the second terminal.

Further, as shown in FIG. 4, in the ProSe information transmissionmethod provided in this embodiment of the present disclosure, that asecond ProSe entity receives a first message sent by a second terminal(step 201) may further include the following steps:

204 b. The second ProSe entity receives a sixth message sent by thesecond terminal, where the sixth message carries a third identity and afirst application identity.

Specifically, in this embodiment of the present disclosure, the secondterminal at a 3GPP network layer starts a monitoring service, andtherefore, the second ProSe entity receives the sixth message sent bythe second terminal, where the sixth message carries the third identityand the first application identity.

205 b. The second ProSe entity determines a fourth identity according tothe third identity and the first application identity.

Specifically, the second ProSe entity may prestore a correspondenceamong the third identity, the first application identity, and the fourthidentity, and after acquiring the third identity and the firstapplication identity, the second ProSe entity may determine the fourthidentity according to the correspondence, which is not specificallylimited in this embodiment of the present disclosure.

206 b. The second ProSe entity sends a seventh message to an applicationserver, where the seventh message carries the fourth identity.

207 b. The second ProSe entity receives an eighth message sent by theapplication server, where the eighth message carries a correspondencebetween a first identity and the second identity, and the correspondencebetween the first identity and the second identity is determined by theapplication server according to the fourth identity.

Specifically, the application server may store a correspondence betweenthe fourth identity and the correspondence between the first identityand the second identity, and therefore, after acquiring the fourthidentity, the application server may determine the correspondencebetween the first identity and the second identity according to thecorrespondence, which is not specifically limited in this embodiment ofthe present disclosure.

208 b. The second ProSe entity sends a ninth message to a first ProSeentity, where the ninth message carries the first identity and the firstapplication identity.

209 b. The second ProSe entity receives a tenth message sent by thefirst ProSe entity, where the tenth message carries a first code word,and the first code word is determined by the first ProSe entityaccording to the first identity and the first application identity.

Specifically, the first ProSe entity may store a correspondence amongthe first identity, the first application identity, and the first codeword, and therefore, after acquiring the first identity and the firstapplication identity, the first ProSe entity may determine the firstcode word according to the correspondence, which is not specificallylimited in this embodiment of the present disclosure.

210 b. The second ProSe entity sends an eleventh message to the secondterminal, where the eleventh message carries the first code word.

Optionally, as shown in FIG. 5, before that a second ProSe entityreceives a first message sent by a second terminal (step 501), the ProSeinformation transmission method provided in this embodiment of thepresent disclosure may further include the following steps:

204 c. The second ProSe entity receives a sixth message sent by anapplication server, where the sixth message carries a correspondencebetween a first identity and the second identity, a first applicationidentity, and a third identity.

Specifically, in this embodiment of the present disclosure, theapplication server at an application layer starts a monitoring service,and the application server may store information such as the thirdidentity, the correspondence between the first identity and the secondidentity, and the first application identity. After being triggered, theapplication server may send, to the second ProSe entity, the sixthmessage that carries the correspondence between the first identity andthe second identity, the first application identity, and the thirdidentity, which is not specifically limited in this embodiment of thepresent disclosure.

205 c. The second ProSe entity sends a seventh message to a first ProSeentity, where the seventh message carries the first identity and thefirst application identity.

206 c. The second ProSe entity receives an eighth message sent by thefirst ProSe entity, where the eighth message carries a first code word,and the first code word is determined by the first ProSe entityaccording to the first identity and the first application identity.

Specifically, the first ProSe entity may store a correspondence amongthe first identity, the first application identity, and the first codeword, and therefore, after acquiring the first identity and the firstapplication identity, the first ProSe entity may determine the firstcode word according to the correspondence, which is not specificallylimited in this embodiment of the present disclosure.

207 c. The second ProSe entity sends a ninth message to the secondterminal, where the ninth message carries the first code word.

Certainly, after that the second ProSe entity sends a ninth message tothe second terminal, where the ninth message carries the first code word(step 207 c), the method may further include:

the second ProSe entity receives a tenth message sent by the secondterminal, where the tenth message is a response message of the ninthmessage; and sends an eleventh message to the application server, wherethe eleventh message is a response message of the sixth message. In thisway, the second ProSe entity can determine, according to the tenthmessage, that the second terminal has acquired the first code word; theapplication server can determine, according to the eleventh message,that the first ProSe entity has acquired the sixth message. Therefore,accuracy and reliability of ProSe information transmission is ensured.

For related denotations of names such as the second ProSe entity, thefirst ProSe entity, the first terminal, the second terminal, the secondidentity, the first application user, the first application identity,the fourth code word, the third identity, the fourth identity, and thesixth identity in this embodiment of the present disclosure, referencemay be made to the foregoing unified illustration part, and details arenot repeatedly described in this embodiment of the present disclosure.

Based on the foregoing ProSe information transmission method provided inthis embodiment of the present disclosure, in one aspect, a second ProSeentity receives a first message sent by a second terminal, where thefirst message is used to instruct the second ProSe entity to acquire asecond identity; and further, the second ProSe entity acquires thesecond identity, and sends, to the second terminal, a second messagethat carries the second identity, where the second identity is used toindicate a first application user discovered by the second terminal. Itmay be learned that, the second ProSe entity can learn an event that asecond application user discovers the first application user, andfurther a first ProSe entity can also learn the event that the secondapplication user discovers the first application user. That is, anetwork can learn an event that two application users discover eachother, which is therefore favorable to expense settlement of an operatorand monitoring of a network event. In another aspect, in a ProSeinformation transmission process, a terminal identity in the prior artis replaced with a temporary terminal identity, and a temporaryapplication user identity in the prior art is replaced with a temporaryapplication user identity, that is, information carried in a process of3GPP communication between a terminal and a ProSe entity iscorresponding information temporarily allocated by the ProSe entity oran application server, and does not belong to personal privacy.Therefore, there is no potential security problem in transmission at a3GPP layer, and the application server may support this transmissionmanner.

This embodiment of the present disclosure further provides a ProSeinformation transmission method, which is specifically shown in FIG. 6,and includes the following steps:

601. A second terminal acquires a fourth code word broadcast by a firstterminal.

602. The second terminal sends a first message to a second ProSe entitywhen the fourth code word matches a prestored code word, where the firstmessage carries the fourth code word and a first application identity.

The first message is used to instruct the second ProSe entity to acquirethe fourth code word and a second identity corresponding to the firstapplication identity.

Specifically, the second terminal may prestore some code words that arebroadcast by a terminal and that the second terminal wants to monitor.For example, if the second terminal wants to monitor a code wordbroadcast by a terminal A, the second terminal may prestore the codeword. In this way, after obtaining, by means of monitoring, the codeword broadcast by the terminal A, the second terminal may determine,according to the stored code word, that the prestored code word includesthe code word broadcast by the terminal A. In this case, it may beconsidered that the code word broadcast by the terminal A matches theprestored code word, and step 602 is performed. Otherwise, if the secondterminal does not prestore the code word obtained by means ofmonitoring, matching fails when the matching is performed on the codeword obtained by means of monitoring and the prestored code word. It maybe considered that although the second terminal obtains the code word bymeans of monitoring, the code word is not a code word that the secondterminal expects to monitor, and step 602 is not performed for themoment.

603. The second terminal receives a second message sent by the secondProSe entity, where the second message carries a second identity.

The second identity is used to indicate a first application userdiscovered by the second terminal.

604. The second terminal discovers a first application user according tothe second identity.

That is, the second terminal confirms, according to the second identity,that the first application user is near the second terminal.

Specifically, the second terminal may include an application unit of afirst application and a 3GPP Layer unit. After acquiring the secondidentity, the 3GPP Layer unit of the second terminal may send the secondidentity to the application unit of the first application of the secondterminal according to the first application identity, and theapplication unit may discover the first application user according tothe second identity.

Optionally, the second message may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

Exemplarily, for example, if the first message carries both anapplication identity A and an application identity B, that is, thesecond terminal detects the fourth code word on both an application Aand an application B, when the second ProSe entity sends the secondmessage to the second terminal, the second message needs to carry thesecond identity and the first application identity corresponding to thesecond identity.

Further, as shown in FIG. 7, when the fourth code word matches theprestored code word, and before that a second terminal acquires a fourthcode word broadcast by a first terminal (step 601), the method mayfurther include the following steps:

605 a. The second terminal sends a third message to the second ProSeentity, where the third message carries a third identity and the firstapplication identity.

606 a. The second terminal receives a fourth message sent by the secondProSe entity, where the fourth message carries the fourth code word.

607 a. The second terminal stores the fourth code word.

Optionally, as shown in FIG. 8, when the fourth code word matches theprestored code word, and before that a second terminal acquires a fourthcode word broadcast by a first terminal (step 601), the method mayfurther include the following steps:

605 b. The second terminal sends a third message to the second ProSeentity, where the third message carries first information, a fourthidentity, and the first application identity, and the first informationincludes a third identity and a sixth identity.

606 b. The second terminal receives a fourth message sent by the secondProSe entity, where the fourth message carries the fourth code word.

Specifically, for step in which after receiving the fourth message, thesecond ProSe entity acquires the fourth code word according to the thirdidentity and the first application identity, reference may be made to adescription on a side of the second ProSe entity, and details are notrepeatedly described in this embodiment of the present disclosure.

607 b. The second terminal stores the fourth code word.

Specifically, because the second terminal may store the first code wordin step 607 a or 607 b, after obtaining, by means of monitoring, thefirst code word broadcast by the first terminal, the second terminal maydetermine, according to the stored code word, that the first code wordmatches the prestored code word.

For related denotations of names such as the first terminal, the secondterminal, the fourth code word, the first application identity, thesecond ProSe entity, the second identity, the first application user,and the third identity in this embodiment of the present disclosure,reference may be made to the foregoing unified illustration part, anddetails are not repeatedly described in this embodiment of the presentdisclosure.

Based on the foregoing ProSe information transmission method provided inthis embodiment of the present disclosure, in one aspect, after a secondterminal acquires a fourth code word broadcast by a first terminal andwhen the fourth code word matches a prestored code word, the secondterminal further sends, to a second ProSe entity, a first message thatcarries the fourth code word and a first application identity. In thisway, the second ProSe entity can acquire a second identity according tothe fourth code word and the first application identity, where thesecond identity is used to indicate a first application user discoveredby the second terminal. It may be learned that, the second ProSe entitycan learn an event that a second application user discovers the firstapplication user, and further a first ProSe entity can also learn theevent that the second application user discovers the first applicationuser. That is, a network can learn an event that two application usersdiscover each other, which is therefore favorable to expense settlementof an operator and monitoring of a network event. In another aspect, ina ProSe information transmission process, a terminal identity in theprior art is replaced with a temporary terminal identity, and anapplication user identity in the prior art is replaced with a temporaryapplication user identity, that is, information carried in a process of3GPP communication between a terminal and a ProSe entity iscorresponding information temporarily allocated by the ProSe entity oran application server, and does not belong to personal privacy.Therefore, there is no potential security problem in transmission at a3GPP layer, and the application server may support this transmissionmanner.

This embodiment of the present disclosure provides a ProSe informationtransmission method. Specifically, as shown in FIG. 9, the methodincludes the following steps:

901. A second terminal acquires a first code word broadcast by a firstterminal.

902. The second terminal sends a first message to a second ProSe entitywhen the first code word matches a prestored code word, where the firstmessage carries the first code word.

Specifically, the second terminal may prestore some code words that arebroadcast by a terminal and that the second terminal wants to monitor.For example, if the second terminal wants to monitor a code wordbroadcast by a terminal A, the second terminal may prestore the codeword. In this way, after obtaining, by means of monitoring, the codeword broadcast by the terminal A, the second terminal may determine,according to the stored code word, that the prestored code word includesthe code word broadcast by the terminal A. In this case, it may beconsidered that the code word broadcast by the terminal A matches theprestored code word, and step 902 is performed. Otherwise, if the secondterminal does not prestore the detected code word, matching fails whenthe matching is performed on the detected code word and the prestoredcode word. It may be considered that although the second terminalobtains the code word by means of monitoring, the code word is not acode word that the second terminal expects to monitor, and step 902 isnot performed for the moment.

903. The second terminal receives a second message sent by the secondProSe entity, where the second message carries a second identity, andthe second identity is used to instruct to discover a first applicationuser.

The second identity is determined by the second ProSe entity accordingto the first code word.

Specifically, the second terminal may include an application unit of afirst application and a 3GPP Layer unit. After acquiring the secondidentity, the 3GPP Layer unit of the second terminal may determine,according to information about an APP ID in the first code word, that anapplication identity corresponding to the first code word is a firstapplication identity; afterward, the 3GPP Layer unit of the secondterminal may send the second identity to the application unit of thefirst application of the second terminal according to the firstapplication identity, and the application unit may discover the firstapplication user according to the second identity.

It should be noted that the second message in step 903 may further carrythe first application identity. In this way, after acquiring the secondidentity and the first application identity, the 3GPP Layer unit of thesecond terminal may send the second identity to the application unit ofthe first application of the second terminal according to the firstapplication identity, and the application unit may discover the firstapplication user according to the second identity. This case is notspecifically limited in this embodiment of the present disclosure.

Further, as shown in FIG. 10, when the first code word matches theprestored code word, and before that a second terminal acquires a firstcode word (step 901), the ProSe information transmission method providedin this embodiment of the present disclosure may further include thefollowing steps:

904 a. The second terminal sends a third message to the second ProSeentity, where the third message carries a third identity and a firstapplication identity.

905 a. The second terminal receives a fourth message sent by the secondProSe entity, where the fourth message carries the first code word.

The first code word is determined by the second ProSe entity accordingto the third identity and the first application identity.

Specifically, the second ProSe entity may prestore a correspondenceamong the third identity, the first application identity, and a fourthidentity. After acquiring the third identity and the first applicationidentity, the second ProSe entity may determine the fourth identityaccording to the correspondence, further acquire a correspondencebetween a first identity and the second identity from an applicationserver according to the fourth identity, and further acquire the firstcode word from a first ProSe entity according to the first identity,which is not specifically limited in this embodiment of the presentdisclosure.

906 a. The second terminal stores the first code word.

Optionally, as shown in FIG. 11, before that a second terminal acquiresa first code word (step 901), the ProSe information transmission methodprovided in this embodiment of the present disclosure may furtherinclude the following steps:

904 b. When an application server is triggered, the second terminalreceives a third message sent by the second ProSe entity, where thethird message carries the first code word.

905 b. The second terminal stores the first code word.

Specifically, because the second terminal may store the first code wordin step 906 a and step 905 b, after obtaining, by means of monitoring,the first code word broadcast by the first terminal, the second terminalmay determine, according to the stored code word, that the first codeword matches the prestored code word.

Certainly, after step 904 b, the second terminal may further send afourth message to the second ProSe entity, where the fourth message is aresponse message of the third message. In this way, the second ProSeentity may determine, according to the fourth message, that the secondterminal has acquired the first code word. Therefore, accuracy andreliability of ProSe information transmission is ensured.

For related denotations of names such as the first terminal, the secondterminal, the first code word, the first ProSe entity, the second ProSeentity, the first application identity, the first application user, thesecond identity, and the third identity in this embodiment of thepresent disclosure, reference may be made to the foregoing unifiedillustration part, and details are not repeatedly described in thisembodiment of the present disclosure.

Based on the foregoing ProSe information transmission method provided inthis embodiment of the present disclosure, in one aspect, after a secondterminal acquires a first code word broadcast by a first terminal, andwhen the first code word matches a prestored code word, the secondterminal further sends, to a second ProSe entity, a first message thatcarries the first code word. In this way, the second ProSe entity candetermine a second identity according to the first code word, where thesecond identity is used to instruct to discover a first applicationuser. It may be learned that, the second ProSe entity can learn an eventthat a second application user discovers the first application user, andfurther a first ProSe entity can also learn the event that the secondapplication user discovers the first application user. That is, anetwork can learn an event that two application users discover eachother, which is therefore favorable to expense settlement of an operatorand monitoring of a network event. In another aspect, in a ProSeinformation transmission process, a terminal identity in the prior artis replaced with a temporary terminal identity, and an application useridentity in the prior art is replaced with a temporary application useridentity, that is, information carried in a process of 3GPPcommunication between a terminal and a ProSe entity is correspondinginformation temporarily allocated by the ProSe entity or an applicationserver, and does not belong to personal privacy. Therefore, there is nopotential security problem in transmission at a 3GPP layer, and theapplication server may support this transmission manner.

This embodiment of the present disclosure further provides a ProSeinformation transmission method, which is specifically shown in FIG. 12,and includes the following steps:

1201. A first ProSe entity receives a first message sent by a firstterminal, where the first message carries second information and a firstapplication identity, and the second information includes a firstidentity or a seventh identity.

1202. The first ProSe entity sends a second message to the firstterminal, where the second message is used to indicate that the firstProSe entity allows the first terminal to perform broadcasting on afirst application.

Specifically, after receiving the first message sent by the firstterminal, the first ProSe entity may determine, according to the secondinformation in the first message, whether to allow the first terminal toperform broadcasting on the first application, which is not specificallylimited in this embodiment of the present disclosure.

In a possible implementation manner, if the second information includesthe seventh identity, after that a first ProSe entity receives a firstmessage sent by a first terminal (step 1201), and before that the firstProSe entity sends a second message to the first terminal (step 1202),the method may further include:

the first ProSe entity allocates the first identity and a fourth codeword to the first terminal; and

that the first ProSe entity sends a second message to the first terminal(step 1202) may specifically include:

a second ProSe entity sends the second message to the first terminal,where the second message carries the first identity and the fourth codeword.

That is, in this embodiment of the present disclosure, the fourth codeword broadcast by the first terminal may be allocated to the firstterminal by the first ProSe entity in a registration process of thefirst terminal, or may be allocated to the first terminal by the firstProSe entity in a broadcast process of the first terminal, which is notspecifically limited in this embodiment of the present disclosure.

Further, the first message may further carry a second identity, afterthat a first ProSe entity receives a first message sent by a firstterminal (step 1201), and before that the first ProSe entity sends asecond message to the first terminal (step 1202), the method may furtherinclude:

the first ProSe entity sends a third message to a first applicationserver, where the third message carries the first identity and thesecond identity; and

the first ProSe entity receives a fourth message sent by the firstapplication server, where the fourth message is used to indicate thatthe first application server allows the first terminal to performbroadcasting on the first application.

In a possible implementation manner, the first message may further carrythe second identity.

If the second information includes the first identity, after that afirst ProSe entity receives a first message sent by a first terminal(step 1201), and before that the first ProSe entity sends a secondmessage to the first terminal (step 1202), the method may furtherinclude:

the first ProSe entity sends a third message to a first applicationserver, where the third message carries the second identity; and

the first ProSe entity receives a fourth message sent by the firstapplication server, where the fourth message is used to indicate thatthe first application server allows the first terminal to performbroadcasting on the first application.

In a possible implementation manner, if the second information includesthe first identity, after that a first ProSe entity receives a firstmessage sent by a first terminal (step 1201), and before that the firstProSe entity sends a second message to the first terminal (step 1202),the method may further include:

the first ProSe entity sends a third message to a first applicationserver, where the third message carries the first identity; and

the first ProSe entity receives a fourth message sent by the firstapplication server, where the fourth message is used to indicate thatthe first application server allows the first terminal to performbroadcasting on the first application.

Optionally, the foregoing fourth message may further carry the secondidentity, and after that the first ProSe entity receives a fourthmessage sent by the first application server, the method may furtherinclude:

storing, by the first ProSe entity, the second identity.

This is not specifically limited in this embodiment of the presentdisclosure.

Further, the fourth message in this embodiment of the present disclosuremay further carry a third identity, and the first ProSe entity mayfurther store the third identity, which is not specifically limited inthis embodiment of the present disclosure.

Further, as shown in FIG. 13, after that the first ProSe entity sends asecond message to the first terminal (step 1202), the method may furtherinclude the following steps:

1203. The first ProSe entity receives a fifth message sent by a secondProSe entity, where the fifth message carries the first identity, andthe fifth message is used to instruct the first ProSe entity to acquirea fourth code word corresponding to the first identity.

1204. The first ProSe entity acquires the fourth code word.

1205. The first ProSe entity sends a sixth message to the second ProSeentity, where the sixth message carries the fourth code word.

Optionally, the fifth message may further carry the third identity.

After that the first ProSe entity receives a fifth message sent by asecond ProSe entity (step 1203), the method may further include:

the first ProSe entity stores the third identity.

This is not specifically limited in this embodiment of the presentdisclosure.

Further, as shown in FIG. 14, after that the first ProSe entity sends asecond message to the first terminal (step 1202), the method may furtherinclude the following steps:

1206. The first ProSe entity receives a seventh message sent by thesecond ProSe entity, where the seventh message carries the fourth codeword and the first application identity, and the seventh message is usedto instruct the first ProSe entity to acquire a first code word and asecond identity corresponding to the first application identity.

1207. The first ProSe entity acquires the second identity.

1208. The first ProSe entity sends an eighth message to the second ProSeentity, where the eighth message carries the second identity.

Optionally, the eighth message may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

Further, after that the first ProSe entity receives a seventh messagesent by the second ProSe entity (step 1206), and before that the firstProSe entity sends an eighth message to the second ProSe entity (step1208), the method may further include:

the first ProSe entity determines whether the second terminal isauthorized to discover a first application user.

If the first ProSe entity determines that the second terminal isauthorized to discover the first application user, step 1208 isperformed.

That is, before sending the eighth message to the second ProSe entity,the first ProSe entity further needs to first determine whether thesecond terminal is authorized to discover the first application user.After determining that the second terminal is authorized to discover thefirst application user, the first ProSe entity sends the eighth messageto the second terminal, which further ensures validity of a monitoringprocess, and therefore ensures network security.

In a possible implementation manner, that the first ProSe entitydetermines whether the second terminal is authorized to discover a firstapplication user may specifically include:

the first ProSe entity determines whether to store the third identity;and

if the first ProSe entity determines to store the third identity, thefirst ProSe entity determines that the second terminal is authorized todiscover the first application user.

That is, if the first ProSe entity stores the third identity in themonitoring process, it may be determined, according to the thirdidentity and in a matching process, that the second terminal isauthorized to discover the first application user.

In a possible implementation manner, the seventh message carries thethird identity, where the third identity is used by the first ProSeentity to determine whether the second terminal is authorized todiscover the first application user.

Further, the fourth code word is further used by the first ProSe entityto determine the first identity, and after that the first ProSe entityreceives a seventh message sent by the second ProSe entity (step 1206),and before that the first ProSe entity sends an eighth message to thesecond ProSe entity (step 1208), the method may further include:

the first ProSe entity sends a ninth message to the first applicationserver, where the ninth message carries the first identity; and

the first ProSe entity receives a tenth message sent by the firstapplication server, where the tenth message is used to indicate that thefirst application server allows the first terminal to performbroadcasting on the first application.

That is, before sending the eighth message to the second ProSe entity,the first ProSe entity may further interact with the first applicationserver, so that whether broadcasting performed on the first applicationby the first terminal is valid is determined by using the firstapplication server. After the first application server allows the firstterminal to perform broadcasting on the first application, the eighthmessage is sent to the second ProSe entity, which further ensuresvalidity of a broadcast process, and therefore ensures network security.

For related denotations of names such as the first ProSe entity, thesecond ProSe entity, the first terminal, the second terminal, the firstidentity, the fourth code word, the seventh identity, the firstapplication server, the third identity, the first application identity,the second identity, and the first application user in this embodimentof the present disclosure, reference may be made to the foregoingunified illustration part, and details are not repeatedly describedherein.

Based on the foregoing ProSe information transmission method provided inthis embodiment of the present disclosure, in one aspect, in a broadcastprocess of a first terminal, a first ProSe entity may receive a firstmessage sent by the first terminal. In this way, the first ProSe entitycan acquire an event that the first terminal performs broadcast, whichis therefore favorable to expense settlement of an operator andmonitoring of a network event. In another aspect, in a ProSe informationtransmission process, a terminal identity in the prior art is replacedwith a temporary terminal identity, and an application user identity inthe prior art is replaced with a temporary application user identity,that is, information carried in a process of 3GPP communication betweena terminal and a ProSe entity is corresponding information temporarilyallocated by the ProSe entity or an application server, and does notbelong to personal privacy. Therefore, there is no potential securityproblem in transmission at a 3GPP layer, and the application server maysupport this transmission manner.

This embodiment of the present disclosure further provides a ProSeinformation transmission method, which is specifically shown in FIG. 15,and includes the following steps:

1501. A first terminal sends a first message to a first ProSe entity,where the first message carries second information and a firstapplication identity, and the second information includes a firstidentity or a seventh identity.

1502. The first terminal receives a second message sent by the firstProSe entity, where the second message is used to indicate that thefirst ProSe entity allows the first terminal to perform broadcasting ona first application.

1503. The first ProSe entity broadcasts a fourth code word.

Optionally, the first message may further carry a second identity, whichis not specifically limited in this embodiment of the presentdisclosure.

The second identity is used to indicate a first application user of thefirst terminal.

Further, if the second information includes the seventh identity, thesecond message may further carry the fourth code word and the firstidentity, which is not specifically limited in this embodiment of thepresent disclosure.

It should be noted that, in this embodiment of the present disclosure,the fourth code word broadcast by the first terminal may be allocated tothe first terminal by the first ProSe entity in a registration processof the first terminal, or may be allocated to the first terminal by thefirst ProSe entity in a broadcast process of the first terminal, whichis not specifically limited in this embodiment of the presentdisclosure.

For related denotations of names such as the first terminal, the firstProSe entity, the first application identity, the first identity, theseventh identity, the fourth code word, and the second identity in thisembodiment of the present disclosure, reference may be made to theforegoing unified illustration part, and details are not repeatedlydescribed in this embodiment of the present disclosure.

Based on the foregoing ProSe information transmission method provided inthis embodiment of the present disclosure, in one aspect, in a broadcastprocess of a first terminal, the first terminal sends a first message toa first ProSe entity. In this way, the first ProSe entity can acquire anevent that the first terminal performs broadcast, which is thereforefavorable to expense settlement of an operator and monitoring of anetwork event. In another aspect, in a ProSe information transmissionprocess, a terminal identity in the prior art is replaced with atemporary terminal identity, and an application user identity in theprior art is replaced with a temporary application user identity, thatis, information carried in a process of 3GPP communication between aterminal and a ProSe entity is corresponding information temporarilyallocated by the ProSe entity or an application server, and does notbelong to personal privacy. Therefore, there is no potential securityproblem in transmission at a 3GPP layer, and the application server maysupport this transmission manner.

Embodiment 2

This embodiment of the present disclosure provides a ProSe informationtransmission method, which is specifically described by usinginteraction between a first terminal, a second terminal, a first ProSeentity, a second ProSe entity, and a first application server as anexample. As shown in FIG. 16, the method includes the following steps:

1601. The second terminal acquires a fourth code word broadcast by thefirst terminal.

1602. The second terminal sends a message 1 to the second ProSe entitywhen the fourth code word matches a prestored code word, where themessage 1 carries the fourth code word and a first application identity.

1603. The second ProSe entity receives the message 1.

1604. The second ProSe entity sends a message 2 to the first ProSeentity, where the message 2 carries the fourth code word and the firstapplication identity.

1605. The first ProSe entity receives the message 2, and acquires,according to the message 2, the fourth code word and a second identitycorresponding to the first application identity.

1606. The first ProSe entity sends a message 3 to the second ProSeentity, where the message 3 carries the second identity.

Optionally, the message 3 may further carry the first applicationidentity, where the first application identity is used to indicate afirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

1607. The second ProSe entity receives the message 3.

1608. The second ProSe entity sends a message 4 to the second terminal,where the message 4 carries the second identity, and the second identityis used to instruct to discover a first application user.

That is, the second identity is used to indicate that the firstapplication user is near the second terminal.

Optionally, the message 4 may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity, which is notspecifically limited in this embodiment of the present disclosure.

It should be noted that steps 1604 to 1608 is merely a possibleimplementation manner in which the second ProSe entity acquires thesecond identity according to the fourth code word and the firstapplication identity. Alternatively, after receiving the message 1, thesecond ProSe entity may directly acquire the second identity accordingto the fourth code word and the first application identity that arecarried in the message 1 and with reference to a prestoredcorrespondence among the fourth code word, the first applicationidentity, and the second identity; or the second identity may beacquired by using other steps, which is not specifically limited in thisembodiment of the present disclosure.

1609. The second terminal receives the message 4, and discovers thefirst application user according to the second identity.

That is, after receiving the message 4, the second terminal confirms,according to the second identity, that the first application user isnear the second terminal.

For a specific implementation manner of steps 1601 to 1609, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

It should be noted that, after that the first ProSe entity receives themessage 2, and acquires, according to the message 2, the fourth codeword and a second identity corresponding to the first applicationidentity (step 1605), and before that the first ProSe entity sends amessage 3 to the second ProSe entity, where the message 3 carries thesecond identity (step 1606), the first ProSe entity may further firstdetermine whether the second terminal is authorized to discover thefirst application user. For specific implementation, reference may bemade to a description on a side of the first ProSe entity in Embodiment1, and details are not repeatedly described herein.

Further, as shown in FIG. 17, before that the second terminal acquires afourth code word broadcast by the first terminal (step 1601), the ProSeinformation transmission method provided in this embodiment of thepresent disclosure may further include the following monitoring process:

1701. The second terminal sends a message 1 to the second ProSe entity,where the message 1 carries a third identity and the first applicationidentity.

1702. The second ProSe entity receives the message 1.

1703. The second ProSe entity sends a message 2 to the first applicationserver according to the first application identity, where the message 2carries the third identity.

1704. The first application server receives the message 2.

1705. The first application server determines a first identity accordingto the third identity.

Optionally, the first application server may further determine thesecond identity according to the third identity.

1706. The first application server sends a message 3 to the second ProSeentity, where the message 3 carries the first identity.

1707. The second ProSe entity receives the message 3.

Optionally, the first application server may further determine thesecond identity according to the third identity, and the message 3 mayfurther carry the second identity, so that the second ProSe entitystores the second identity, which is not specifically limited in thisembodiment of the present disclosure.

1708. The second ProSe entity sends a message 4 to the first ProSeentity, where the message 4 carries the first identity.

1709. The first ProSe entity receives the message 4.

1710. The first ProSe entity determines the fourth code word accordingto the first identity.

Optionally, the message 4 may further carry the third identity, so thatafter receiving the message 4, the first ProSe entity stores the thirdidentity, which is not specifically limited in this embodiment of thepresent disclosure.

1711. The first ProSe entity sends a message 5 to the second ProSeentity, where the message 5 carries the fourth code word.

1712. The second ProSe entity receives the message 5.

1713. The second ProSe entity sends a message 6 to the second terminal,where the message 6 carries the fourth code word.

1714. The second terminal receives the message 6 and stores the fourthcode word.

For a specific implementation manner of steps 1701 to 1714, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Optionally, as shown in FIG. 18, before that the second terminalacquires a fourth code word broadcast by the first terminal (step 1601),the ProSe information transmission method provided in this embodiment ofthe present disclosure may further include the following monitoringprocess:

1801. The second terminal sends a message 1 to the second ProSe entity,where the message 1 carries first information, a fourth identity, andthe first application identity, and the first information includes athird identity or a sixth identity.

1802. The second ProSe entity receives the message 1.

1803. The second ProSe entity sends a message 2 to the first applicationserver according to the first application identity, where the message 2carries the fourth identity.

1804. The first application server receives the message 2.

Optionally, if the first information includes the sixth identity, thesecond ProSe entity may further allocate the third identity to thesecond terminal, and the message 2 may further carry the third identity,so that the first application server stores the third identity, which isnot specifically limited in this embodiment of the present disclosure.

1805. The first application server determines a first identity accordingto the third identity.

1806. The first application server sends a message 3 to the second ProSeentity, where the message 3 carries the first identity.

1807. The second ProSe entity receives the message 3.

Optionally, the first application server may further determine thesecond identity according to the third identity, and the message 3 mayfurther carry the second identity, so that the second ProSe entitystores the second identity, which is not specifically limited in thisembodiment of the present disclosure.

1808. The second ProSe entity sends a message 4 to the first ProSeentity, where the message 4 carries the first identity.

1809. The first ProSe entity receives the message 4.

1810. The first ProSe entity determines the fourth code word accordingto the first identity.

Optionally, the message 4 may further carry the third identity, so thatafter receiving the message 4, the first ProSe entity stores the thirdidentity, which is not specifically limited in this embodiment of thepresent disclosure.

1811. The first ProSe entity sends a message 5 to the second ProSeentity, where the message 5 carries the fourth code word.

1812. The second ProSe entity receives the message 5.

1813. The second ProSe entity sends a message 6 to the second terminal,where the message 6 carries the fourth code word.

1814. The second terminal receives the message 6 and stores the fourthcode word.

For a specific implementation manner of steps 1701 to 1714, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Further, as shown in FIG. 19, before that the second terminal acquires afourth code word broadcast by the first terminal (step 1601), the ProSeinformation transmission method provided in this embodiment of thepresent disclosure may further include the following broadcast process:

1901. The first terminal sends a message 1 to the first ProSe entity,where the message 1 carries a first identity and the first applicationidentity.

1902. The first ProSe entity receives the message 1.

1903. The first ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the first identity.

1904. The first application server receives the message 2, anddetermines, according to the first identity, that the first terminal isallowed to perform broadcasting on a first application.

1905. The first application server sends a message 3 to the first ProSeentity, where the message 3 is used to indicate that the firstapplication server allows the first terminal to perform broadcast on thefirst application.

1906. The first ProSe entity receives the message 3.

1907. The first ProSe entity sends a message 4 to the first terminal,where the message 4 is used to indicate that the first ProSe entityallows the first terminal to perform broadcasting on the firstapplication.

1908. The first terminal receives the message 4 and broadcasts thefourth code word.

For a specific implementation manner of steps 1901 to 1908, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Optionally, as shown in FIG. 20, before that the second terminalacquires a fourth code word broadcast by the first terminal (step 1601),the ProSe information transmission method provided in this embodiment ofthe present disclosure may further include the following broadcastprocess:

2001. The first terminal sends a message 1 to the first ProSe entity,where the message 1 carries a first identity, the second identity, andthe first application identity.

2002. The first ProSe entity receives the message 1.

2003. The first ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the second identity.

2004. The first application server receives the message 2, anddetermines, according to the second identity, that the first terminal isallowed to perform broadcasting on a first application.

2005. The first application server sends a message 3 to the first ProSeentity, where the message 3 is used to indicate that the firstapplication server allows the first terminal to perform broadcasting onthe first application.

2006. The first ProSe entity receives the message 3.

2007. The first ProSe entity sends a message 4 to the first terminal,where the message 4 is used to indicate that the first ProSe entityallows the first terminal to perform broadcasting on the firstapplication.

2008. The first terminal receives the message 4 and broadcasts thefourth code word.

For a specific implementation manner of steps 2001 to 2008, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Optionally, as shown in FIG. 21, before that the second terminalacquires a fourth code word broadcast by the first terminal (step 1601),the ProSe information transmission method provided in this embodiment ofthe present disclosure may further include the following broadcastprocess:

2101. The first terminal sends a message 1 to the first ProSe entity,where the message 1 carries a seventh identity, the second identity, andthe first application identity.

2102. The first ProSe entity receives the message 1.

2103. The first ProSe entity allocates a first identity and the fourthcode word to the first terminal.

2104. The first ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the second identity and the firstidentity.

2105. The first application server receives the message 2, anddetermines, according to the second identity, that the first terminal isallowed to perform broadcasting on a first application.

2106. The first application server sends a message 3 to the first ProSeentity, where the message 3 is used to indicate that the firstapplication server allows the first terminal to perform broadcasting onthe first application.

2107. The first ProSe entity receives the message 3.

2108. The first ProSe entity sends a message 4 to the first terminal,where the message 4 carries the fourth code word and is used to indicatethat the first ProSe entity allows the first terminal to performbroadcasting on the first application.

2109. The first terminal receives the message 4 and broadcasts thefourth code word.

For a specific implementation manner of steps 2101 to 2109, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

This embodiment is a specific description of Embodiment 1; therefore,for technical effects that can be achieved in this embodiment, referencemay be made to the foregoing descriptions, and details are notrepeatedly described herein.

Embodiment 3

This embodiment of the present disclosure provides a ProSe informationtransmission method, which is specifically described by usinginteraction between a first terminal, a second terminal, a first ProSeentity, a second ProSe entity, and a first application server as anexample. As shown in FIG. 22A and FIG. 22B are, the method includes thefollowing steps:

2201. The second terminal acquires a first code word broadcast by thefirst terminal.

2202. The second terminal sends a message 1 to the second ProSe entitywhen the first code word matches a prestored code word, where themessage 1 carries the first code word.

2203. The second ProSe entity receives the message 1.

2204. The second ProSe entity determines a second identity according tothe first code word.

2205. The first ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the second identity.

2206. The first application server receives the message 2, anddetermines, according to the second identity, that an broadcast requestof a first application user is allowed.

2207. The first application server sends a message 3 to the second ProSeentity, where the message 3 indicates that the broadcast request of thefirst application user is allowed.

2208. The second ProSe receives the message 3.

2209. The second ProSe entity sends a message 4 to the second terminal,where the message 4 carries the second identity, and the second identityis used to instruct to discover the first application user.

2210. The second terminal receives the message 4.

2211. The second ProSe entity sends a message 5 to the first ProSeentity, where the message 5 carries a first identity, a firstapplication identity, and a fourth identity.

2212. The first ProSe entity receives the message 5, where the firstidentity and the first application identity are used to instruct todiscover the first application user.

2213. The first ProSe entity sends a message 6 to the first applicationserver, where the message 6 carries the fourth identity.

2214. The first application server receives the message 6, and acquiresuser information of a second application user at an application layeraccording to the fourth identity.

2215. The first application server sends a message 7 to the first ProSeentity, where the message 7 carries the user information of the secondapplication user at the application layer.

2216. The first ProSe entity receives the message 7.

2217. The first ProSe entity sends a message 22 to the first terminal,where the message 22 carries the fourth identity, and the fourthidentity is used to indicate that the first application user isdiscovered by the second application user.

2218. The first terminal receives the message 22.

For a specific implementation manner of steps 2201 to 2218, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Further, as shown in FIG. 23A and FIG. 23B, before that the secondterminal acquires a first code word broadcast by the first terminal(step 2201), the ProSe information transmission method provided in thisembodiment of the present disclosure may further include the followingsteps:

2301. The second terminal sends a message 1 to the second ProSe entity,where the message 1 carries a third identity and the first applicationidentity.

2302. The second ProSe entity receives the message 1.

2303. The second ProSe entity determines the fourth identity accordingto the third identity and the first application identity.

2304. The second ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the fourth identity.

2305. The first application server receives the message 2.

2306. The first application server determines a correspondence betweenthe first identity and the second identity according to the fourthidentity.

2307. The first application server sends a message 3 to the second ProSeentity, where the message 3 carries the correspondence between the firstidentity and the second identity.

2308. The second ProSe entity receives the message 3.

2309. The second ProSe entity sends a message 4 to the first ProSeentity, where the message 4 carries the first identity and the firstapplication identity.

2310. The first ProSe entity receives the message 4.

2311. The first ProSe entity determines the first code word according tothe first identity and the first application identity.

2312. The first ProSe entity sends a message 5 to the second ProSeentity, where the message 5 carries the first code word.

2313. The first ProSe entity receives the message 5.

2314. The first ProSe entity sends a message 6 to the second terminal,where the message 6 carries the first code word.

2315. The second terminal receives the message 6 and stores the firstcode word.

For a specific implementation manner of steps 2301 to 2315, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Further, as shown in FIG. 24, before that the second terminal acquires afirst code word broadcast by the first terminal (step 2201), the ProSeinformation transmission method provided in this embodiment of thepresent disclosure may further include the following steps:

2401. The first terminal sends a message 1 to the first ProSe entity,where the message 1 carries the first identity and the first applicationidentity.

2402. The first ProSe entity receives the message 1.

2403. The first ProSe entity allocates the first code word to the secondidentity according to the first identity and the first applicationidentity.

2404. The first ProSe entity sends a message 2 to the first applicationserver, where the message 2 carries the second identity.

2405. The first application server receives the message 2, anddetermines, according to the second identity, that the broadcast requestof the first application user is allowed.

2406. The first application server sends a message 3 to the second ProSeentity, where the message 3 is used to indicate that the broadcastrequest of the first application user is allowed.

2407. The first ProSe entity receives the message 3.

2408. The first ProSe entity sends a message 4 to the first terminal,where the message 4 carries the first code word.

2409. The first terminal receives the message 4.

2410. The first terminal broadcasts the first code word.

For a specific implementation manner of steps 2401 to 2410, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Optionally, as shown in FIG. 25, before that the second terminalacquires a first code word broadcast by the first terminal (step 2201),the ProSe information transmission method provided in this embodiment ofthe present disclosure may further include the following steps:

2501. The first application server sends a message 1 to the second ProSeentity, where the message 1 carries a correspondence between the firstidentity and the second identity, the first application identity, and athird identity.

2502. The second ProSe entity receives the message 1.

2503. The second ProSe entity sends a message 2 to the first ProSeentity, where the message 2 carries the first identity and the firstapplication identity.

2504. The first ProSe entity receives the message 2.

2505. The first ProSe entity determines the first code word according tothe first identity and the first application identity.

2506. The first ProSe entity sends a message 3 to the second ProSeentity, where the message 3 carries the first code word.

2507. The second ProSe entity receives the message 3.

2508. The second ProSe entity sends a message 4 to the second terminal,where the message 4 carries the first code word.

2509. The second terminal receives the message 4.

2510. The second terminal sends a message 5 to the second ProSe entity,where the message 5 is a response message of the message 4.

2511. The second ProSe entity receives the message 5.

2512. The second ProSe entity sends a message 6 to the first applicationserver, where the message 6 is a response message of the message 1.

2513. The first application server receives the message 6.

For a specific implementation manner of steps 2501 to 2513, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

Further, as shown in FIG. 26, before that the second terminal acquires afirst code word broadcast by the first terminal (step 2201), the ProSeinformation transmission method provided in this embodiment of thepresent disclosure may further include the following steps:

2601. The first application server sends a message 1 to the first ProSeentity, where the message 1 carries the first identity and the firstapplication identity.

2602. The first ProSe entity receives the message 1.

2603. The first ProSe entity allocates the first code word to the secondidentity according to the first identity and the first applicationidentity.

2604. The first ProSe entity sends a message 2 to the first terminal,where the message 2 carries the first code word.

2605. The first terminal receives the message 2.

2606. The first terminal sends a message 3 to the first ProSe entity,where the message 3 is a response message of the message 2.

2607. The first ProSe entity receives the message 3.

2608. The first ProSe entity sends a message 4 to the first applicationserver, where the message 4 is a response message of the message 1.

2609. The first application server receives the message 4.

2610. The first terminal broadcasts the first code word.

It should be noted that there is no definite sequence between step 2610and steps 2606 to 2609. Step 2610 may be performed before steps 2606 to2609, or step 2610 may be performed after steps 2606 to 2609, which isnot specifically limited in this embodiment of the present disclosure.

For a specific implementation manner of steps 2601 to 2610, referencemay be made to related descriptions of corresponding steps in Embodiment1, and details are not repeatedly described in this embodiment of thepresent disclosure.

This embodiment is a specific description of Embodiment 1; therefore,for technical effects that can be achieved in this embodiment, referencemay be made to the foregoing descriptions, and details are notrepeatedly described herein.

Embodiment 4

This embodiment of the present disclosure provides a second ProSe entity2700, which is specifically shown in FIG. 27. The second ProSe entity2700 includes: a receiving unit 2701, a sending unit 2702, and anacquiring unit 2703.

The receiving unit 2701 is configured to receive a first message sent bya second terminal, where the first message is used to instruct thesecond ProSe entity 2700 to acquire a second identity.

The acquiring unit 2703 is configured to acquire the second identity.

The sending unit 2702 is configured to send a second message to thesecond terminal, where the second message carries the second identity.

The second identity is used to indicate a first application userdiscovered by the second terminal.

Optionally, the second message may further carry a first applicationidentity, where the first application identity is an applicationidentity of a first application, and the first application identity isused to indicate the first application corresponding to the secondidentity.

In a possible implementation manner, the first message carries a fourthcode word and the first application identity.

The acquiring unit 2703 is specifically configured to:

send a third message to a first ProSe entity, where the third messagecarries the fourth code word and the first application identity, so thatthe first ProSe entity acquires the fourth code word and the secondidentity corresponding to the first application identity; and

receive a fourth message sent by the first ProSe entity, where thefourth message carries the second identity.

Optionally, the fourth message may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity.

Further, the receiving unit 2701 is further configured to: beforereceiving the first message sent by the second terminal, receive a fifthmessage sent by the second terminal, where the fifth message is used toinstruct the second ProSe entity 2700 to acquire the fourth code word.

The acquiring unit 2703 is further configured to acquire the fourth codeword.

The sending unit 2702 is further configured to send a sixth message tothe second terminal, where the sixth message carries the fourth codeword.

In a possible implementation manner, the fifth message carries a thirdidentity and the first application identity.

The acquiring unit 2703 is specifically configured to:

send a seventh message to a first application server according to thefirst application identity, where the seventh message carries the thirdidentity;

receive an eighth message sent by the first application server, wherethe eighth message carries a first identity, and the first identity is atemporary terminal identity that is allocated to a first terminal by thefirst ProSe entity;

send a ninth message to the first ProSe entity, where the ninth messagecarries the first identity; and

receive a tenth message sent by the first ProSe entity, where the tenthmessage carries the fourth code word.

In another possible implementation manner, the fifth message carriesfirst information, a fourth identity, and the first applicationidentity, where the first information includes a third identity or asixth identity.

The acquiring unit 2703 is specifically configured to:

send a seventh message to a first application server according to thefirst application identity, where the seventh message carries the fourthidentity;

receive an eighth message sent by the first application server, wherethe eighth message carries a first identity, and the first identity is atemporary terminal identity that is allocated to a first terminal by thefirst ProSe entity;

send a ninth message to the first ProSe entity, where the ninth messagecarries the first identity; and

receive a tenth message sent by the first ProSe entity, where the tenthmessage carries the fourth code word.

In a possible implementation manner, the first message may carry a firstcode word.

The acquiring unit 2703 is specifically configured to:

acquire the second identity according to the first code word.

Further, the sending unit 2702 is further configured to: before sendingthe second message to the second terminal, send a third message to afirst application server, where the third message carries the secondidentity, and the second identity is a basis on which the firstapplication server determines that an broadcast request of a firstapplication user is allowed.

The receiving unit 2701 is further configured to receive a fourthmessage sent by the first application server, where the fourth messageindicates that the broadcast request of the first application user isallowed.

Further, the sending unit 2702 is further configured to: after sendingthe second message to the second terminal, send a fifth message to afirst ProSe entity, where the fifth message carries a first identity,the first application identity, and a fourth identity, the firstidentity is a temporary terminal identity that is allocated to the firstterminal by the first ProSe entity, the first application identity isthe application identity of the first application, the fourth identityis a temporary application user identity that is allocated to a secondapplication user by the first application server, and the secondapplication user is a user of the first application of the secondterminal.

Further, as shown in FIG. 28, the second ProSe entity further includes adetermining unit 2704.

The receiving unit 2701 is further configured to: before receiving thefirst message, receive a sixth message sent by the second terminal,where the sixth message carries a third identity and the firstapplication identity.

The determining unit 2704 is configured to determine the fourth identityaccording to the third identity and the first application identity.

The sending unit 2702 is further configured to send a seventh message tothe first application server, where the seventh message carries thefourth identity.

The receiving unit 2701 is further configured to receive an eighthmessage sent by the first application server, where the eighth messagecarries a correspondence between the first identity and the secondidentity, and the correspondence between the first identity and thesecond identity is determined by the first application server accordingto the fourth identity.

The sending unit 2702 is further configured to send a ninth message tothe first ProSe entity, where the ninth message carries the firstidentity and the first application identity.

The receiving unit 2701 is further configured to receive a tenth messagesent by the first ProSe entity, where the tenth message carries thefirst code word, and the first code word is determined by the firstProSe entity according to the first identity and the first applicationidentity.

The sending unit 2702 is further configured to send an eleventh messageto the second terminal, where the eleventh message carries the firstcode word.

Optionally, the receiving unit 2701 is further configured to: beforereceiving the first message, receive a sixth message sent by the firstapplication server, where the sixth message carries a correspondencebetween the first identity and the second identity, the firstapplication identity, and a third identity.

The sending unit 2702 is further configured to send a seventh message tothe first ProSe entity, where the seventh message carries the firstidentity and the first application identity.

The receiving unit 2701 is further configured to receive an eighthmessage sent by the first ProSe entity, where the eighth message carriesthe first code word, and the first code word is determined by the firstProSe entity according to the first identity and the first applicationidentity.

The sending unit 2702 is further configured to send the ninth message tothe second terminal, where the ninth message carries the first codeword.

For related denotations of names such as the second ProSe entity, thefirst ProSe entity, the first terminal, the second terminal, the secondidentity, the first application user, the first application identity,the fourth code word, the third identity, the fourth identity, and thesixth identity in this embodiment of the present disclosure, referencemay be made to the foregoing unified illustration part, and details arenot repeatedly described in this embodiment of the present disclosure.

It should be noted that, among units and modules of the second ProSeentity 2700 provided in this embodiment of the present disclosure, thesending unit 2702 may be specifically implemented by using atransmitter; the receiving unit 2701 may be specifically implemented byusing a receiver; the acquiring unit 2703 and the determining unit 2704may be specifically implemented by using a processor, where thereceiver, the processor, and the transmitter can communicate with eachother, which is not specifically limited in this embodiment of thepresent disclosure.

Specifically, for a ProSe information transmission method performed byusing the second ProSe entity 2700, reference may be made todescriptions of Embodiment 1 to Embodiment 3, which are not repeatedlydescribed in this embodiment of the present disclosure.

The second ProSe entity in this embodiment can be used to perform theforegoing method; therefore, for technical effects that can be achievedby the second ProSe entity, reference may be made to a description inthe foregoing embodiment, and details are not repeatedly describedherein.

Embodiment 5

This embodiment of the present disclosure provides a second terminal2900, which is specifically shown in FIG. 29. The second terminal 2900includes: an acquiring unit 2901, a sending unit 2902, a receiving unit2903, and a discovery unit 2904.

The acquiring unit 2901 is configured to acquire a fourth code wordbroadcast by a first terminal.

The sending unit 2902 is configured to send a first message to a secondProSe entity when the fourth code word matches a prestored code word,where the first message carries the fourth code word and a firstapplication identity.

The receiving unit 2903 is configured to receive a second message sentby the second ProSe entity, where the second message carries a secondidentity.

The second identity is used to indicate a first application userdiscovered by the second terminal.

The discovery unit 2904 is configured to discover the first applicationuser according to the second identity.

That is, the discovery unit 2904 is configured to confirm, according tothe second identity, that the first application user is near the secondterminal.

Optionally, the second message may further carry the first applicationidentity, where the first application identity is used to indicate thefirst application corresponding to the second identity.

Further, the sending unit 2902 is further configured to send a thirdmessage to the second ProSe entity when the fourth code word matches theprestored code word and before the acquiring unit 2901 acquires thefourth code word broadcast by the first terminal, where the thirdmessage carries a third identity and the first application identity.

The receiving unit 2903 is further configured to receive a fourthmessage sent by the second ProSe entity, where the fourth messagecarries the fourth code word.

Optionally, the sending unit 2902 is further configured to send a thirdmessage to the second ProSe entity when the fourth code word matches theprestored code word and before the acquiring unit 2901 acquires thefourth code word broadcast by the first terminal, where the thirdmessage carries first information, a fourth identity, and the firstapplication identity, and the first information includes a thirdidentity or a sixth identity.

The receiving unit 2903 is further configured to receive a fourthmessage sent by the second ProSe entity, where the fourth messagecarries the fourth code word.

For related denotations of names such as the first terminal, the secondterminal, the fourth code word, the first application identity, thesecond ProSe entity, the second identity, the first application user,and the third identity in this embodiment of the present disclosure,reference may be made to the foregoing unified illustration part, anddetails are not repeatedly described in this embodiment of the presentdisclosure.

It should be noted that, among units and modules of the second terminal2900 provided in this embodiment of the present disclosure, theacquiring unit 2901 and the discovery unit 2904 may be specificallyimplemented by using a processor; the sending unit 2902 may bespecifically implemented by using a transmitter; the receiving unit 2903may be specifically implemented by using a receiver, where theprocessor, the receiver, and the transmitter can communicate with eachother, which is not specifically limited in this embodiment of thepresent disclosure.

Specifically, for a ProSe information transmission method performed byusing the second terminal 2900, reference may be made to a descriptionof Embodiment 1 or Embodiment 2, which are not repeatedly described inthis embodiment of the present disclosure.

The second terminal in this embodiment can be used to perform theforegoing method; therefore, for technical effects that can be achievedby the second terminal, reference may be made to a description in theforegoing embodiment, and details are not repeatedly described herein.

Embodiment 6

This embodiment of the present disclosure provides a second terminal3000, which is specifically shown in FIG. 30. The second terminal 3000includes an acquiring unit 3001, a sending unit 3002, and a receivingunit 3003.

The acquiring unit 3001 is configured to acquire a first code wordbroadcast by a first terminal.

The sending unit 3002 is configured to send a first message to a secondProSe entity when the first code word matches a prestored code word,where the first message carries the first code word.

The receiving unit 3003 is configured to receive a second message sentby the second ProSe entity, where the second message carries a secondidentity, the second identity is determined by the second ProSe entityaccording to the first code word, and the second identity is used toinstruct to discover a first application user.

Further, the sending unit 3002 is further configured to: when the firstcode word matches the prestored code word, and before the acquiring unit3001 acquires the first code word broadcast by the first terminal, senda third message to the second ProSe entity, where the third messagecarries a third identity and a first application identity.

The receiving unit 3003 is further configured to receive a fourthmessage sent by the second ProSe entity, where the fourth messagecarries the first code word, and the first code word is determined bythe second ProSe entity according to the third identity and the firstapplication identity.

Optionally, the receiving unit 3003 is further configured to: before theacquiring unit 3001 acquires the first code word, when an applicationserver is triggered, receive a third message sent by the second ProSeentity, where the third message carries the first code word.

Further, the sending unit 3002 is further configured to: after thereceiving unit 3003 receives the third message sent by the second ProSeentity, send a fourth message to the second ProSe entity, where thefourth message is a response message of the third message.

It should be noted that, among units and modules of the second terminal3000 provided in this embodiment of the present disclosure, theacquiring unit 3001 may be specifically implemented by using aprocessor; the sending unit 3002 may be specifically implemented byusing a transmitter; the receiving unit 3003 may be specificallyimplemented by using a receiver, where the processor, the receiver, andthe transmitter can communicate with each other, which is notspecifically limited in this embodiment of the present disclosure.

Specifically, for a ProSe information transmission method performed byusing the second terminal 3000, reference may be made to a descriptionof Embodiment 1 or Embodiment 3, which are not repeatedly described inthis embodiment of the present disclosure.

The second terminal in this embodiment can be used to perform theforegoing method; therefore, for technical effects that can be achievedby the second terminal, reference may be made to a description in theforegoing embodiment, and details are not repeatedly described herein.

The foregoing descriptions are merely specific implementation manners ofthe present disclosure, but are not intended to limit the protectionscope of the present disclosure. Any variation or replacement readilyfigured out by a person skilled in the art within the technical scopedisclosed in the present disclosure shall fall within the protectionscope of the present disclosure. Therefore, the protection scope of thepresent disclosure shall be subject to the protection scope of theclaims.

What is claimed is:
 1. A proximity service (ProSe) informationtransmission method, wherein the method comprises: receiving, by areceiving ProSe entity, a first message sent by a monitoring terminal,the first message instructing the receiving ProSe entity to acquire afirst application user identity that is allocated to a first applicationuser by a first application server, the first application user being auser of a first application of a first terminal, the first messagecomprising a code word allocated by a first ProSe entity, the firstapplication server being an application server of the first application,and the receiving ProSe entity being a ProSe entity in a first homepublic land mobile network (HPLMN) of the monitoring terminal;acquiring, by the receiving ProSe entity, the first application useridentity by, sending to the first ProSe entity the code word received inthe first message, and in response, receiving from the first ProSeentity the first application user identity, wherein the first ProSeentity is in a second HPLMN of the first terminal, the code word beingrelated to a plurality of application user identities including thefirst application user identity, and the second HPLMN being a differentHPLMN than the first HPLMN; and sending, by the receiving ProSe entity,a second message to the monitoring terminal, the second messagecomprising the first application user identity received from the firstProSe entity, the first application user identity indicating the firstapplication user discovered by the monitoring terminal.
 2. The methodaccording to claim 1, wherein the first application user identitycomprises a temporary application user identity (Temp APP User ID) or areal application user identity allocated by the application server. 3.The method according to claim 1, further comprising: before receivingthe first message sent by the monitoring terminal, receiving, by thereceiving ProSe entity, a fifth message sent by the monitoring terminal,the fifth message instructing the receiving ProSe entity to acquire thecode word allocated to the first terminal by the first ProSe entity;acquiring, by the receiving ProSe entity, the code word; and sending, bythe receiving ProSe entity, a sixth message to the monitoring terminal,wherein the sixth message comprises the code word.
 4. The methodaccording to claim 3, wherein the fifth message comprises a thirdidentity and the application identity, the third identity comprising atemporary terminal identity allocated to the monitoring terminal by thereceiving ProSe entity, and the application identity identifying thefirst application; and acquiring the code word comprises: sending, bythe receiving ProSe entity, a seventh message to the first applicationserver according to the application identity, wherein the seventhmessage comprises the third identity; receiving, by the receiving ProSeentity, an eighth message sent by the first application server, theeighth message comprising a first identity, the first identitycomprising a temporary terminal identity allocated to the first terminalby the first ProSe entity; sending, by the receiving ProSe entity, aninth message to the first ProSe entity, the ninth message comprisingthe first identity; and receiving, by the receiving ProSe entity, atenth message sent by the first ProSe entity, the tenth messagecomprising the code word.
 5. The method according to claim 3, whereinthe fifth message comprises first information, a fourth identity, andthe application identity, the first information comprising a thirdidentity or a sixth identity, the third identity comprising a temporaryterminal identity allocated to the monitoring terminal by the receivingProSe entity, the sixth identity comprising a terminal identity of themonitoring terminal, the fourth identity comprising a temporaryapplication user identity allocated to a second application user by thefirst application server, the second application user being a user ofthe first application of the monitoring terminal, and the applicationidentity being the application identity of the first application; andacquiring the code word comprises: sending, by the receiving ProSeentity, a seventh message to the first application server according tothe application identity, the seventh message comprising the fourthidentity; receiving, by the receiving ProSe entity, an eighth messagesent by the first application server, the eighth message comprising afirst identity, the first identity comprising a temporary terminalidentity allocated to the first terminal by the first ProSe entity;sending, by the receiving ProSe entity, a ninth message to the firstProSe entity, the ninth message comprising the first identity; andreceiving, by the receiving ProSe entity, a tenth message sent by thefirst ProSe entity, the tenth message comprising the code word.
 6. Themethod according to claim 1, further comprising: before sending thesecond message to the monitoring terminal, sending, by the receivingProSe entity, a third message to the first application server, the thirdmessage comprising the first application user identity, the firstapplication user identity configured to cause the first applicationserver to determine whether a broadcast request of the first applicationuser is allowed; and receiving, by the receiving ProSe entity, a fourthmessage sent by the first application server, the fourth messageindicating whether the broadcast request of the first application useris allowed.
 7. The method according to claim 6, further comprising:after sending the second message to the monitoring terminal, sending, bythe receiving ProSe entity, a fifth message to the first ProSe entity,the fifth message comprising a first identity, the application identity,and a fourth identity, the first identity comprising a temporaryterminal identity allocated to the first terminal by the first ProSeentity, the application identity identifying the first application, thefourth identity comprising a temporary application user identityallocated to a second application user by the first application server,the second application user being a user of the first application of themonitoring terminal.
 8. The method according to claim 1, furthercomprising: before receiving the first message, receiving, by thereceiving ProSe entity, a sixth message sent by the monitoring terminal,the sixth message comprising a third identity and the applicationidentity, the third identity comprising a temporary terminal identityallocated to the monitoring terminal by the receiving ProSe entity, andthe application identity identifying the first application; determining,by the receiving ProSe entity, a fourth identity according to the thirdidentity and the application identity, the fourth identity comprising atemporary application user identity allocated to a second applicationuser by the first application server, the second application user beingthe user of the first application of the monitoring terminal; sending,by the receiving ProSe entity, a seventh message to the firstapplication server, the seventh message comprising the fourth identity;receiving, by the receiving ProSe entity, an eighth message sent by thefirst application server, the eighth message comprising a correspondencebetween the first identity and the first application user identity, thecorrespondence between the first identity and the first application useridentity being determined by the first application server according tothe fourth identity, the first identity comprising the temporaryterminal identity allocated to the first terminal by the first ProSeentity; sending, by the receiving ProSe entity, a ninth message to thefirst ProSe entity, the ninth message comprising the first identity andthe application identity; receiving, by the receiving ProSe entity, atenth message sent by the first ProSe entity, the tenth messagecomprising the code word, the code word being determined by the firstProSe entity according to the first identity and the applicationidentity; and sending, by the receiving ProSe entity, an eleventhmessage to the monitoring terminal, wherein the eleventh messagecomprises the code word.
 9. The method according to claim 1, furthercomprising: before receiving, by the receiving ProSe entity, the firstmessage, receiving, by the receiving ProSe entity, a sixth message sentby the first application server, the sixth message comprising acorrespondence between the first identity and the first application useridentity, the application identity, and a third identity, the firstidentity comprising a temporary terminal identity allocated to the firstterminal by the first ProSe entity, the application identity identifyingthe first application, and the third identity comprising a temporaryterminal identity allocated to the monitoring terminal by the receivingProSe entity; sending, by the receiving ProSe entity, a seventh messageto the first ProSe entity, the seventh message comprising the firstidentity and the application identity; receiving, by the receiving ProSeentity, an eighth message sent by the first ProSe entity, the eighthmessage comprising the code word, the code word being determined by thefirst ProSe entity according to the first identity and the applicationidentity; and sending, by the receiving ProSe entity, a ninth message tothe monitoring terminal, the ninth message comprising the code word. 10.A proximity service ProSe information transmission method, wherein themethod comprises: receiving, by a monitoring terminal from a firstterminal, a code word; and discovering, by the monitoring terminal, afirst application user according to a first application user identityby: sending, by the monitoring terminal, a first message to a receivingProSe entity when the received code word matches a prestored code word,the first message instructing the receiving ProSe entity to acquire thefirst application user identity that is allocated to the firstapplication user by a first application server, the first applicationuser being a user of a first application of a first terminal, the firstapplication server being an application server of the first application,the first message comprising the received code word allocated by a firstProSe entity, the receiving ProSe entity being a ProSe entity in a firsthome public land mobile network (HPLMN) of the monitoring terminal;receiving, by the monitoring terminal, a second message sent by thereceiving ProSe entity, the second message comprising a firstapplication user identity, the first application user identity beingsent to the receiving ProSe entity by a first ProSe entity after thefirst ProSe entity receives the code word sent by the receiving ProSeentity, wherein the first ProSe entity is in a second HPLMN of the firstterminal, the code word being related to a plurality of application useridentities including the first application user identity, and the secondHPLMN being a different HPLMN than the first HPLMN.
 11. The methodaccording to claim 10, wherein the first application user identitycomprises a temporary application user identity (Temp APP User ID) or areal application user identity allocated by the application server. 12.The method according to claim 10, the method further comprising:acquiring, by the monitoring terminal, the code word when the firstterminal is broadcasting the code word, wherein the first messagecomprising the code word and a first application identity, the firstapplication identity identifying a first application corresponding tothe first application user identity, and the second message furthercomprises the first application identity.
 13. The method according toclaim 10, further comprising: sending, by the monitoring terminal, athird message to the receiving ProSe entity, the third messagecomprising a third identity and a first application identity, the thirdidentity comprising a temporary terminal identity allocated to themonitoring terminal by the receiving ProSe entity; receiving, by themonitoring terminal, a fourth message sent by the receiving ProSeentity, the fourth message comprising a code word for prestoring; andacquiring, by the monitoring terminal, the code word when the firstterminal is broadcasting the code word; wherein the first messagecomprises the code word and is sent when the code word matches the codeword for prestoring.
 14. The method according to claim 10, furthercomprising: sending, by the monitoring terminal, a third message to thereceiving ProSe entity, the third message comprising first information,a fourth identity, and a first application identity, the firstinformation comprising a third identity or a sixth identity, the thirdidentity comprising a temporary terminal identity allocated to themonitoring terminal by the receiving ProSe entity, the sixth identityidentifying the monitoring terminal, the fourth identity comprising atemporary application user identity allocated to a second applicationuser by the first application server, the second application user beinga user of the first application of the monitoring terminal; receiving,by the monitoring terminal, a fourth message sent by the receiving ProSeentity, wherein the fourth message comprising a code word forprestoring; and acquiring, by the monitoring terminal, the code wordwhen the first terminal is broadcasting the code word; wherein the firstmessage comprises the code word and is sent when the code word matchesthe code word for prestoring.
 15. A receiving ProSe entity, comprising:a receiver, a transmitter, a processor, and an acquiring circuit;wherein: the receiver is configured to receive a first message sent by amonitoring terminal, the first message being used to instruct thereceiving ProSe entity to acquire a first application user identity thatis allocated to a first application user by a first application server,the first application user being a user of a first application of afirst terminal, the first message comprising a code word allocated by afirst ProSe entity, the first application server being an applicationserver of the first application, and the receiving ProSe entity being aProSe entity in a first home public land mobile network (HPLMN) of themonitoring terminal; the acquiring circuit is configured to acquire thefirst application user identity by, sending by the processor to thefirst ProSe entity the code word received by the receiver in the firstmessage, and in response, receiving by the processor from the firstProSe entity the first application user identity, wherein the firstProSe entity is in a second HPLMN of the first terminal, the code wordbeing related to a plurality of application user identities includingthe first application user identity, and the second HPLMN being adifferent HPLMN than the first HPLMN; and the transmitter is configuredto send a second message to the monitoring terminal, the second messagecomprising the first application user identity received by the acquiringcircuit.
 16. The receiving ProSe entity according to claim 15, whereinthe first application user identity comprises a temporary applicationuser identity (Temp APP User ID) or a real application user identityallocated by the application server.